#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define i_7 1000000007 #define i_5 1000000005 ll mod(ll a){ ll c=a%i_7; if(c>=0)return c; else return c+i_7; } typedef pair i_i; typedef pair l_l; #define inf 100000000/*10^8*/ #define rep(i,l,r) for(int i=l;i<=r;i++) const double EPS=1E-8; //////////////////////////////////////// int main(){ int a[10];memset(a,0,sizeof(a)); char s[200005];cin>>s; int b[10]={20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841}; a[s[0]-'0']++; rep(i,2,200001){ a[s[i]-'0']++; } int f,q; rep(i,0,9){ a[i]-=b[i]; if(a[i]==1)q=i; if(a[i]==-1)f=i; } cout<