#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(i, n) for (int i = 0; i < (int)(n); ++i) //#define cerr if(false) cerr #ifdef DEBUG #define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__); #else #define show(...) 42 #endif using namespace std; using ll = long long; using pii = pair; template ostream& operator<<(ostream& os, pair a) { os << '(' << a.first << ',' << a.second << ')'; return os; } template ostream& operator<<(ostream& os, vector v) { for (auto x : v) os << x << ' '; return os; } void debug() { cerr << '\n'; } template void debug(H a, T... b) { cerr << a; if (sizeof...(b)) cerr << ", "; debug(b...); } int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; string s; cin >> s; int ans = 0; int cnt1 = 0, cnt9 = 0; rep(i,n){ if(s[i] == '3' or s[i] == '5' or s[i] == '7')ans++; else if(s[i] == '1')cnt1++; else cnt9++; } ans += cnt1/2; if(cnt1&1 and cnt9)ans++; cout << ans << endl; }