
#include <iostream>
#include <vector>
using namespace std;

int busca(const vector<char>& v, char c);

int main() {
   char c, d;
   vector<char> a;
   cin >> c;
   while (cin >> d) { 
      a.push_back(d); 
   }
   cout << busca(a, c) << endl;   
}
