/*** author: yuji9511 ***/ #include using namespace std; typedef long long ll; typedef pair lpair; const ll MOD = 1e9+7; const ll INF = 1e18; #define rep(i,m,n) for(ll i=(m);i<(n);i++) #define rrep(i,m,n) for(ll i=(m);i>=(n);i--) #define printa(x,n) for(ll i=0;i void print(H&& h, T&&... t){cout<(t)...);} int main(){ cin.tie(0); ios::sync_with_stdio(false); ll N; string S; cin >> N >> S; ll ans = 0; string T = ""; rep(i,0,N){ if(S[i] == '3' || S[i] == '5' || S[i] == '7'){ ans++; }else{ T += S[i]; } } ll sz = T.size(); ll cnt1 = 0; rep(i,0,sz){ if(T[i] == '1'){ cnt1++; }else{ if(cnt1 > 0){ ans++; cnt1--; } } } ans += cnt1/2; print(ans); }