#include using namespace std; #define ALL(x) x.begin(),x.end() #define rep(i,n) for(int i=0;i<(n);i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<bool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(b>n; string s;cin>>s; string t=""; int ans=0; for(auto c:s){ if(c=='3' or c=='5' or c=='7') ans++; else t.push_back(c); } if(t.empty()){ cout< 991 -> 11 stack st; int a=0,b=0; rep(i,m){ if(t[i]=='9'){ if(a)a--,ans++; else b++; }else{ a++; } } while(b and a){ if(b>=2 and a>=1){ b-=2,a--,ans++; }else{ break; } } ans+=a/2; cout<