#include <iostream>
using namespace std;
int main ()
{
    int n1,c1,n2,c2,k,A,B;
    cin>>n1>>c1;
    cin>>n2>>c2;
    cin>>k;
    if (n1+n2<k) cout<<"The barrels are not enough."<<endl; else
                  if (c1==c2) cout<<"The barrels are from the same kind."<<endl; else
                  if (c1==A) c2=B; else c1==B; c2==A;
                              if (c1==A) if (n1<k) cout<<n1<<endl; else cout<<n1-(n1-k)<<endl;
    return 0;
}
