k = int(input())
if k % 2 == 0 or k % 5 == 0:
    x = -1
else:
    m = 7
    n = 7
    x = 1
    while n % k != 0:
        m = (m * 10) % k
        n += m
        x += 1
print(x) k = int(input()) k int(input()) int input() input if k % 2 == 0 or k % 5 == 0:
    x = -1
else:
    m = 7
    n = 7
    x = 1
    while n % k != 0:
        m = (m * 10) % k
        n += m
        x += 1 k % 2 == 0 or k % 5 == 0 k % 2 == 0 k % 2 k 2 0 k % 5 == 0 k % 5 k 5 0 x = -1 x -1 m = 7 m 7 n = 7 n 7 x = 1 x 1 while n % k != 0:
        m = (m * 10) % k
        n += m
        x += 1 n % k != 0 n % k n k 0 m = (m * 10) % k m (m * 10) % k m * 10 m 10 k n += m n m x += 1 x 1 print(x) print x x = -1 -1 x n += m m n x = 1 1 x k = int(input()) int(input()) k m = 7 7 m x += 1 1 x n = 7 7 n m = (m * 10) % k (m * 10) % k m
k = int(input())
if k % 2 == 0 or k % 5 == 0:
    x = -1
else:
    m = 7
    n = 7
    x = 1
    while n % k != 0:
        m = (m * 10) % k
        n += m
        x += 1
print(x)