#include using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef pair P; int main(){ int n; cin >> n; string s; cin >> s; int res = 0,cnt1 = 0,cnt9 = 0; rep(i,n) { if (s[i] == '3' || s[i] == '5' || s[i] == '7') res++; if (s[i] == '1') cnt1++; if (s[i] == '9') { cnt9++; if (cnt1 > 0) cnt1--,cnt9--,res++; } } int cnt991 = min(cnt9/2, cnt1); res += cnt991; res += (cnt1 - cnt991)/2; cout << res << endl; return 0; }