#include #define rep(i, n) for (int i = 0; i < (n); i++) #define repr(i, n) for (int i = (n) - 1; i >= 0; i--) #define rep2(i, l, r) for (int i = (l); i < (r); i++) #define rep2r(i, l, r) for (int i = (r) - 1; i >= (l); i--) #define range(a) a.begin(), a.end() using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); int n; cin >> n; string s; cin >> s; int i = s.size() - 1; int ans = 0; while (i >= 0) { if (s[i] == '3' || s[i] == '5' || s[i] == '7') { ans++; i--; } else if (s[i] == '1') { if (i >= 1 && s[i - 1] == '1') { ans++; i -= 2; } else if (i >= 2 && s[i - 1] == '9' && s[i - 2] == '9') { ans++; i -= 3; } else { i--; } } else if (s[i] == '9') { if (i >= 1 && s[i - 1] == '1') { ans++; i -= 2; } else if (i >= 1 && s[i - 1] == '5') { ans++; i -= 2; } else { i--; } } } cout << ans << endl; }