global_output = 0


def read_input():
    global global_output
    n = int(input())
    if n == 0:
        print(global_output)
        return
    elif n % 7 == 0 or '7' in str(n):
        global_output += 1
    read_input()


read_input()

1a8c172d4f5a8cb43efeea9c34136caff8aee5a9
<mask token>

<mask token>


def read_input():
    global global_output
    n = int(input())
    if n == 0:
        print(global_output)
        return
    elif n % 7 == 0 or '7' in str(n):
        global_output += 1
    read_input()


<mask token>

<mask token>


def read_input():
    global global_output
    n = int(input())
    if n == 0:
        print(global_output)
        return
    elif n % 7 == 0 or '7' in str(n):
        global_output += 1
    read_input()


read_input()

global_output = 0


def read_input():
    global global_output
    n = int(input())
    if n == 0:
        print(global_output)
        return
    elif n % 7 == 0 or '7' in str(n):
        global_output += 1
    read_input()


read_input()
