K = int(input())
if K%2==0 or K%5==0:
    print(-1)
else:
    ans = 1
    rest = 7%K
    while rest != 0:
        rest *= 10
        rest += 7
        rest %= K
        ans += 1
    print(ans) K = int(input()) K int(input()) int input() input if K%2==0 or K%5==0:
    print(-1)
else:
    ans = 1
    rest = 7%K
    while rest != 0:
        rest *= 10
        rest += 7
        rest %= K
        ans += 1
    print(ans) K%2==0 or K%5==0 K%2==0 K%2 K 2 0 K%5==0 K%5 K 5 0 print(-1) print -1 ans = 1 ans 1 rest = 7%K rest 7%K 7 K while rest != 0:
        rest *= 10
        rest += 7
        rest %= K
        ans += 1
     rest != 0 rest 0 rest *= 10 rest 10 rest += 7 rest 7 rest %= K rest K ans += 1 ans 1 print(ans) print ans rest %= K K rest rest += 7 7 rest K = int(input()) int(input()) K rest *= 10 10 rest ans += 1 1 ans ans = 1 1 ans rest = 7%K 7%K rest
K = int(input())
if K%2==0 or K%5==0:
    print(-1)
else:
    ans = 1
    rest = 7%K
    while rest != 0:
        rest *= 10
        rest += 7
        rest %= K
        ans += 1
    print(ans)