#include #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; template bool chmax(T &a, const T &b) { if (a bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; } int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; string s; cin >> s; int one = 0; int ans = 0; rep(i, n){ if(s[i] == '3' || s[i] == '5' || s[i] == '7') ans++; if(s[i] == '1') one++; if(s[i] == '9'){ if(one > 0){ one--; ans++; } } } ans += one / 2; cout << ans << endl; }