#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n>>s; Int ans=0,one=0; for(char c:s){ if(c=='1') one++; } for(char c:s){ if(c=='9') if(one) ans++,one--; if(c=='3'||c=='5'||c=='7') ans++; } ans+=one/2; cout<