#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
int main()
{
int i=0;
unordered_map<int,int>hash;
while(cin>>i)
{
hash[i]=1;
}
string a;
int count=0;
for(i=1;i<=10000;i++)
{
if(hash.count(i)==0)
{
a+=to_string(i);
count++;
if(count==3)
{
break;
}
}
}
int len=a.size();
long long ans=0;
for(i=0;i<len;i++)
{
ans*=10;
ans+=a[i]-'0';
}
cout<<ans%7;
return 0;
}



京公网安备 11010502036488号