print(len(list(filter(lambda x: x % 6 == 0, [int(input()) for i in range(int(input('Введите количество чисел: ')))]))))