n = int(input()) s = input().strip() count_1 = 0 rest = [] for c in s: if c in {'3', '5', '7'}: count_1 += 1 else: rest.append(c) count_2 = 0 i = 0 while i < len(rest) - 1: if (rest[i] == '1' and rest[i+1] == '1') or (rest[i] == '1' and rest[i+1] == '9'): count_2 += 1 i += 2 else: i += 1 print(count_1 + count_2)