K = int(input())
N = 10**6
a = [0] * N

a[0] = 7
for i in range(1, N):
    a[i] = (a[i-1] * 10 + 7) % K
a[0] %= K
for i in range(N):
    if a[i] == 0:
        print(i+1)
        break
else:
    print(-1) K = int(input()) K int(input()) int input() input N = 10**6 N 10**6 10 6 a = [0] * N a [0] * N [0] 0 N a[0] = 7 a[0] a 0 7 for i in range(1, N):
    a[i] = (a[i-1] * 10 + 7) % K i range(1, N) range 1 N a[i] = (a[i-1] * 10 + 7) % K a[i] a i (a[i-1] * 10 + 7) % K a[i-1] * 10 + 7 a[i-1] * 10 a[i-1] a i-1 i 1 10 7 K a[0] %= K a[0] a 0 K for i in range(N):
    if a[i] == 0:
        print(i+1)
        break
else:
    print(-1) i range(N) range N if a[i] == 0:
        print(i+1)
        break a[i] == 0 a[i] a i 0 print(i+1) print i+1 i 1 break print(-1) print -1 a = [0] * N [0] * N a N = 10**6 10**6 N K = int(input()) int(input()) K
K = int(input())
N = 10**6
a = [0] * N

a[0] = 7
for i in range(1, N):
    a[i] = (a[i-1] * 10 + 7) % K
a[0] %= K
for i in range(N):
    if a[i] == 0:
        print(i+1)
        break
else:
    print(-1)