#include // ver2.2.3 #define int long long #define endl "\n" #define ALL(v) (v).begin(),(v).end() #define Vi vector #define VVi vector #define Vs vector #define Pii pair #define VPii vector #define Tiii tuple #define PQi priority_queue #define PQir priority_queue,greater> #define pb push_back #define mp make_pair #define mt make_tuple #define itos to_string #define stoi stoll #define FI first #define SE second #define cYES cout<<"YES"<()) #define rep(i,a,b) for(int i=a;i=b;i--) #define leng(n) (int)(log10(n)+1) #define dem(a,b) ((a+b-1)/(b)) #define Vin(a) rep(iI,0,a.size())cin>>a[iI] #define Vout(a) rep(lZ,0,a.size()-1)cout<(today),m = get<1>(today),d = get<2>(today); if(mdays(y,m) > d) return mt(y,m,d+1); if(mdays(y,m) == d) { if(m!=12) return mt(y,m+1,1); else return mt(y+1,1,1); } } signed main() { cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<> n; string s; cin >> s; int ans=0,one=0,nine=0; rep(i,0,n){ if(s[i]=='3'||s[i]=='7'||s[i]=='5') ans++; else if(s[i]=='9' && one>0){ ans++; one--; } else if(s[i]=='9' && one==0) nine++; else if(s[i]=='1') one++; /*else if(s[i]=='1' && nine >= 2) { nine -= 2; ans++; }*/ } if(nine>=2 && one>=1){ int ct = min(nine/2,one); ans += ct; one -= ct; } ans += one/2; cout<