#include using namespace std; #define all(x) begin(x), end(x) using ll = long long; using ld = long double; using pii = pair; using vi = vector; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; string s; cin >> n >> s; int ans = 0; int ones = 0; for (char c : s) { if (c == '1') { ++ones; } else if (c == '9') { } else { ++ans; } } cout << ans + (ones / 2) << '\n'; return 0; }