#include #define rep(i,n) for( int i=0; i> n; string s; cin >> s; int c[5]; rep(i,5){c[i]=0;} int cnt19 = 0; int over9 = 0; int cnt991 = 0; vector v; rep(i,s.length()){ c[(s[i]-'1')/2]++; if ( s[i] == '9' ){ auto t = find( v.begin(), v.end(), 1 ); if ( t != v.end() ){ v.erase(t); cnt19++; } else { v.push_back(9); } } if ( s[i] == '1' ){ v.push_back(1); } } rep(i,v.size()){ if ( v[i] == 1 ){ if(1