#include<iostream>
#include<string>
using namespace std;
bool find_str(string s1,string s2)
{
if(s1.empty()||s2.empty())
return false;
string::size_type pos=s1.find(s2);
return (pos!=string::npos)?true:false;
}
int main()
{
string s1;
cin>>s1;
string s2;
cin>>s2;
cout<<find_str(s1,s2)<<endl;
system("pause");
return 0;
}