#include #include int main() { using namespace std; int n; string s; cin >> n >> s; string happy = "HAPPY"; int ans = 0; for (int i = 0; i < 5; i++) { if (s[i + n - 5] != happy[i]) { s[i + n - 5] = happy[i]; ans++; } } for (int i = 0; i < n - 5; i++) { bool is_happy = true; for (int j = 0; j < 5; j++) { if (s[i + j] != happy[j]) { is_happy = false; break; } } if (is_happy) { ans++; } } cout << ans << endl; }