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. 
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 11 19:18:14 2017

@author: ms
"""
def div_step(kal, bol):
    zero_add = 0
    it = 0
    
    while (kal<bol):
        kal = int(str(int(kal)) + '0')
        it += 1
        if (it > 1):
            zero_add += 1
        
    tmp = int(kal/bol)
    
    new_kal = kal - bol*tmp
    
    res = str(tmp)
    for i in range(zero_add):
        res = ('0' + res)
        
    return new_kal, res

def check(full, mem):
    s = ''
    for i in range(len(mem)):
        s = s + mem[i]
    #print(s)
    if (len(full)<2*len(s)):
        return True
    
    for i in range(len(full) - 2*len(s) + 1):
        #print(full[i:i+len(s)])
        if (full[i:i+len(s)] == s):
            return False
        else:
            return True

def main():
    a, b, c = [float(x) for x in input().split()]
    after_comma = ''
    count = 0
    tmp = int(a/b)
    kal = a - (b*tmp)
    
    mem = []
    if (kal == 0):
        if (c == 0):
            print(1)
        else:
            print(-1)
        return
    
    c = int(c)
    while(1):
        kal, res = div_step(kal, b)
        mem.append(res)
        #print(mem)
        if (len(mem)>4):
            mem.pop(0)
        
        for i in range(len(res)):
            count += 1
            #print('d1', c, res[i])
            if (res[i] == str(c)):
                print(count)
                return
            if (kal == 0):
                if (c == 0):
                    print(count+1)
                elif (str(c) == res[len(res)-1]):
                    print(len(res))
                else:
                    print(-1)
                return
        after_comma = after_comma + res
        #print('d2',after_comma)
        go = check(after_comma, mem)
        #print('d3',go)
        if (not go):
            print(-1)
            return
            
    print(count)
    
main()