k = int(input())
a = [0 for _ in range(k)]
n = 7

a[0] = 7 % k
for i in range(1, k):
    a[i] = (a[i - 1] * 10 + 7) % k

for i in range(0, k):
    if a[i] == 0:
        print(i + 1)
        exit(0)
print(-1) k = int(input()) k int(input()) int input() input 0 for _ in range(k) for _ in range(k) _ range(k) range k for _ in range(k) 0 a = [0 for _ in range(k)] a [0 for _ in range(k)] n = 7 n 7 a[0] = 7 % k a[0] a 0 7 % k 7 k for i in range(1, k):
    a[i] = (a[i - 1] * 10 + 7) % k i range(1, k) range 1 k 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 for i in range(0, k):
    if a[i] == 0:
        print(i + 1)
        exit(0) i range(0, k) range 0 k if a[i] == 0:
        print(i + 1)
        exit(0) a[i] == 0 a[i] a i 0 print(i + 1) print i + 1 i 1 exit(0) exit 0 print(-1) print -1 k = int(input()) int(input()) k a = [0 for _ in range(k)] [0 for _ in range(k)] a n = 7 7 n
k = int(input())
a = [0 for _ in range(k)]
n = 7

a[0] = 7 % k
for i in range(1, k):
    a[i] = (a[i - 1] * 10 + 7) % k

for i in range(0, k):
    if a[i] == 0:
        print(i + 1)
        exit(0)
print(-1)