from bisect import bisect_left, bisect_right from collections import Counter, defaultdict, deque from collections.abc import Iterable from fractions import Fraction from functools import cache from heapq import heappop, heappush from itertools import ( combinations, combinations_with_replacement, groupby, permutations, product, repeat, chain, ) import io import math import string import sys import time import operator # ===== 設定・制限解除 ===== # fmt: off sys.setrecursionlimit(2 * 10**6) sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8") input = sys.stdin.readline def print(*args, sep=" ", end="\n"): sys.stdout.write(sep.join(map(str, args)) + end) # fmt: on # ===== 定数・リスト ===== LOW = list(string.ascii_lowercase) # 小文字 a-z の文字列リスト UPP = list(string.ascii_uppercase) # 大文字 A-Z の文字列リスト NUM = list(string.digits) # 数字 0-9 の文字列リスト INF = float("inf") # MOD = 998244353 # MOD = 10**9 + 7 DIR4 = [(0, 1), (0, -1), (1, 0), (-1, 0)] DIR8 = [(-1, 1), (0, 1), (1, 1), (-1, 0), (1, 0), (-1, -1), (0, -1), (1, -1)] DIR9 = DIR8 + [(0, 0)] flag, ans, cnt = False, 5, 0 # ===== Go Writing ===== N = int(input()) S = input() A = "HAPPY" S[:-5].replace(A, ",") ans += S.count(",") for i in range(1, 6): if S[-1 * i] == A[i - 1]: ans -= 1