You have a fraction <image>. You need to find the first occurrence of digit c into decimal notation of the fraction after decimal point.

Input

The first contains three single positive integers a, b, c (1 ≤ a < b ≤ 105, 0 ≤ c ≤ 9).

Output

Print position of the first occurrence of digit c into the fraction. Positions are numbered from 1 after decimal point. It there is no such position, print -1.

Examples

Input

1 2 0


Output

2

Input

2 3 7


Output

-1

Note

The fraction in the first example has the following decimal notation: <image>. The first zero stands on second position.

The fraction in the second example has the following decimal notation: <image>. There is no digit 7 in decimal notation of the fraction. 
def convert(numerator, denominator):
    integer_part = str(numerator // denominator)
    ans = ''
    l = dict()
    i = 0

    numerator = numerator % denominator
    l[numerator] = i
    i += 1

    if numerator == 0:
        return integer_part

    while True:
        if numerator == 0:
            return '{}.{}'.format(integer_part, ans)

        digit, numerator = divmod(numerator * 10, denominator)
        ans += str(digit)
        if numerator not in l:
            l[numerator] = i
            i += 1
        else:
            return '{}.{}({})'.format(integer_part, ans[:l[numerator]], ans[l[numerator]:])
def main():
    a, b, c = map(int, input().split())
    k = convert(a, b)
    s = str(k)
    s = s[s.find('.')+1:]
    period = s.find('(')
    if period >= 0:
        s = s[:period] + s[period+1:s.find(')')]
    else:
        s = s + '0'
    ans = s.find(str(c))
    if ans >= 0:
        print(ans+1)
    else:
        print(-1)
main()