using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

namespace CodeforcesTemplate
{
    public static class Permutation
    {
        private static bool Next(ref int[] arr)
        {
            int k, j, l;
            for (j = arr.Length - 2; (j >= 0) && (arr[j] >= arr[j + 1]); j--) { }
            if (j == -1)
            {
                arr = arr.OrderBy(c => c).ToArray();
                return false;
            }
            for (l = arr.Length - 1; (arr[j] >= arr[l]) && (l >= 0); l--) { }
            var tmp = arr[j];
            arr[j] = arr[l];
            arr[l] = tmp;
            for (k = j + 1, l = arr.Length - 1; k < l; k++, l--)
            {
                tmp = arr[k];
                arr[k] = arr[l];
                arr[l] = tmp;
            }
            return true;
        }
        public static IEnumerable<int[]> AllPermutations(int[] arr)
        {
            do yield return arr;
            while (Next(ref arr));
        }
    }

    class Program
    {
        private const string FILENAME = "distance4";

        private const string INPUT = FILENAME + ".in";

        private const string OUTPUT = FILENAME + ".out";

        private static Stopwatch _stopwatch = new Stopwatch();

        private static StreamReader _reader = null;
        private static StreamWriter _writer = null;

        private static string[] _curLine;
        private static int _curTokenIdx;

        private static char[] _whiteSpaces = new char[] { ' ', '\t', '\r', '\n' };

        private static string ReadNextToken()
        {
            if (_curTokenIdx >= _curLine.Length)
            {
                //Read next line
                string line = _reader.ReadLine();
                if (line != null)
                    _curLine = line.Split(_whiteSpaces, StringSplitOptions.RemoveEmptyEntries);
                else
                    _curLine = new string[] { };
                _curTokenIdx = 0;
            }

            if (_curTokenIdx >= _curLine.Length)
                return null;

            return _curLine[_curTokenIdx++];
        }

        private static int ReadNextInt()
        {
            return int.Parse(ReadNextToken());
        }

        private static void RunTimer()
        {
#if (DEBUG)

            _stopwatch.Start();

#endif
        }

        private static void Main(string[] args)
        {

#if (DEBUG)
            double before = GC.GetTotalMemory(false);
#endif

            string[] sp = Console.ReadLine().Split();

            int[] a = new int[3];

            for (int i = 0; i < 3; ++i)
            {
                a[i] = int.Parse(sp[i]);
            }

            HashSet<int> hashSet = new HashSet<int>();

            a[0] %= a[1];
            int d = -1;
            int pos = 0;
            while (a[0] != 0 && (!hashSet.Contains(a[0])))
            {
                hashSet.Add(a[0]);
                a[0] *= 10;
                d = a[0] / a[1];
                if (d == a[2])
                {
                    break;
                }

                ++pos;
                a[0] %= a[1];
            }

            Console.WriteLine((d == a[2] || a[0] == a[2]) ? pos + 1 : -1);

#if (DEBUG)
            _stopwatch.Stop();

            double after = GC.GetTotalMemory(false);

            double consumedInMegabytes = (after - before) / (1024 * 1024);

            Console.WriteLine($"Time elapsed: {_stopwatch.Elapsed}");

            Console.WriteLine($"Consumed memory (MB): {consumedInMegabytes}");

            Console.ReadKey();
#endif

        }

        private static int CountLeadZeros(string source)
        {
            int countZero = 0;

            for (int i = source.Length - 1; i >= 0; i--)
            {
                if (source[i] == '0')
                {
                    countZero++;
                }

                else
                {
                    break;
                }

            }

            return countZero;
        }

        private static string ReverseString(string source)
        {
            char[] reverseArray = source.ToCharArray();

            Array.Reverse(reverseArray);

            string reversedString = new string(reverseArray);

            return reversedString;
        }

        private static int[] CopyOfRange(int[] src, int start, int end)
        {
            int len = end - start;
            int[] dest = new int[len];
            Array.Copy(src, start, dest, 0, len);
            return dest;
        }

        private static string StreamReader()
        {

            if (_reader == null)
                _reader = new StreamReader(INPUT);
            string response = _reader.ReadLine();
            if (_reader.EndOfStream)
                _reader.Close();
            return response;

        }

        private static void StreamWriter(string text)
        {

            if (_writer == null)
                _writer = new StreamWriter(OUTPUT);
            _writer.WriteLine(text);

        }

        private static int BFS(int start, int end, int[,] arr)
        {
            Queue<KeyValuePair<int, int>> queue = new Queue<KeyValuePair<int, int>>();
            List<bool> visited = new List<bool>();
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                visited.Add(false);
            }

            queue.Enqueue(new KeyValuePair<int, int>(start, 0));
            KeyValuePair<int, int> node;
            int level = 0;
            bool flag = false;

            while (queue.Count != 0)
            {
                node = queue.Dequeue();
                if (node.Key == end)
                {
                    return node.Value;
                }
                flag = false;
                for (int i = 0; i < arr.GetLength(0); i++)
                {

                    if (arr[node.Key, i] == 1)
                    {
                        if (visited[i] == false)
                        {
                            if (!flag)
                            {
                                level = node.Value + 1;
                                flag = true;
                            }
                            queue.Enqueue(new KeyValuePair<int, int>(i, level));
                            visited[i] = true;
                        }
                    }
                }

            }
            return 0;

        }

        private static void Write(string source)
        {
            File.WriteAllText(OUTPUT, source);
        }

        private static string ReadString()
        {
            return File.ReadAllText(INPUT);
        }

        private static void WriteStringArray(string[] source)
        {
            File.WriteAllLines(OUTPUT, source);
        }

        private static string[] ReadStringArray()
        {
            return File.ReadAllLines(INPUT);
        }

        private static int[] GetIntArray()
        {
            return ReadString().Split(' ').Select(int.Parse).ToArray();
        }

        private static double[] GetDoubleArray()
        {
            return ReadString().Split(' ').Select(double.Parse).ToArray();
        }

        private static int[,] ReadINT2XArray(List<string> lines)
        {
            int[,] arr = new int[lines.Count, lines.Count];

            for (int i = 0; i < lines.Count; i++)
            {
                int[] row = lines[i].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

                for (int j = 0; j < lines.Count; j++)
                {
                    arr[i, j] = row[j];
                }
            }

            return arr;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace problemB
{
    class Program
    {
        static void Main(string[] args)
        {
            var sp = Console.ReadLine().Split();
            int[] a = new int[3];
            for (int i = 0; i < 3; ++i)
                a[i] = int.Parse(sp[i]);

            System.Collections.Generic.HashSet<int> hashSet = new System.Collections.Generic.HashSet<int>();

            a[0] %= a[1];
            int d = -1;
            int pos = 0;
            while(a[0] != 0 && (!hashSet.Contains(a[0])))
            {
                hashSet.Add(a[0]);
                a[0] *= 10;
                d = a[0] / a[1];
                if (d == a[2])
                    break;
                ++pos;
                a[0] %= a[1];
            }
            Console.WriteLine((d == a[2] || a[0] == a[2]) ? pos+1 : -1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test
{
    class IOHelper : IDisposable
    {
        StreamReader reader;
        StreamWriter writer;

        public IOHelper(string inputFile, string outputFile, Encoding encoding)
        {
            StreamReader iReader;
            StreamWriter oWriter;
            if (inputFile == null)
                iReader = new StreamReader(Console.OpenStandardInput(), encoding);
            else
                iReader = new StreamReader(inputFile, encoding);

            if (outputFile == null)
                oWriter = new StreamWriter(Console.OpenStandardOutput(), encoding);
            else
                oWriter = new StreamWriter(outputFile, false, encoding);

            reader = iReader;
            writer = oWriter;

            curLine = new string[] { };
            curTokenIdx = 0;
        }

        string[] curLine;
        int curTokenIdx;

        char[] whiteSpaces = new char[] { ' ', '\t', '\r', '\n' };

        public string ReadNextToken()
        {
            if (curTokenIdx >= curLine.Length)
            {
                //Read next line
                string line = reader.ReadLine();
                if (line != null)
                    curLine = line.Split(whiteSpaces, StringSplitOptions.RemoveEmptyEntries);
                else
                    curLine = new string[] { };
                curTokenIdx = 0;
            }

            if (curTokenIdx >= curLine.Length)
                return null;

            return curLine[curTokenIdx++];
        }

        public int ReadNextInt()
        {
            return int.Parse(ReadNextToken());
        }

        public double ReadNextDouble()
        {
            var nextToken = ReadNextToken();
            var result = 0.0;
            nextToken = nextToken.Replace(".", System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator);
            result = double.Parse(nextToken);
            return result;
        }

        public void Write(string stringToWrite)
        {
            writer.Write(stringToWrite);
        }

        public void WriteLine(string stringToWrite)
        {
            writer.WriteLine(stringToWrite);
        }

        public void WriteLine(double valueToWrite)
        {
            long intPart = (long)valueToWrite;
            double fracPart = valueToWrite - intPart;
            var fracPartStr = fracPart.ToString();
            if (fracPartStr.Length > 1)
                fracPartStr = fracPartStr.Substring(2);
            var strToWrite = string.Format("{0}.{1}", intPart, fracPartStr);
            writer.WriteLine(strToWrite);
        }

        public void Dispose()
        {
            try
            {
                if (reader != null)
                {
                    reader.Dispose();
                }
                if (writer != null)
                {
                    writer.Dispose();
                }
            }
            catch { };
        }

        public void Flush()
        {
            if (writer != null)
            {
                writer.Flush();
            }
        }
    }

    class Program
    {
        protected IOHelper ioHelper;

        int a,b,c;

        public void Solve()
        {
            a = ioHelper.ReadNextInt();
            b = ioHelper.ReadNextInt();
            c = ioHelper.ReadNextInt();

            HashSet<int> reminders = new HashSet<int>();

            int curPos = 1;
            int rez = -1;

            a *= 10;

            do
            {
                if (rez != -1)
                    break;

                if (reminders.Contains(a))
                    break;

                while (a < b)
                {
                    a *= 10;
                    if (c == 0)
                    { rez = curPos; break; }
                    curPos++;
                }

                if (rez != -1)
                    break;

                if (reminders.Contains(a))
                    break;

                reminders.Add(a);
                var vl = a / b;

                int numDig = 0;
                int foundAt = -1;
                int curDigit = 0;
                while(vl > 0)
                {
                    var digit = vl % 10;
                    if (digit == c)
                        foundAt = curDigit;
                    numDig++;
                    vl /= 10;
                }

                if(foundAt != -1)
                {
                    rez = curPos + numDig - foundAt - 1;
                }

                curPos += numDig;

                //curPos++;
                a %= b;
                if (a == 0 && c == 0)
                    rez = curPos;
                else
                    a *= 10;
            } while (a != 0);

            ioHelper.WriteLine(rez.ToString());
            ioHelper.Flush();

            //Console.ReadKey();
        }

        public Program(string inputFile, string outputFile)
        {
            ioHelper = new IOHelper(inputFile, outputFile, Encoding.Default);
            Solve();
            ioHelper.Dispose();
        }

        static void Main(string[] args)
        {
            Program myProgram = new Program(null, null);
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Position_in_Fraction
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            writer.WriteLine(Solve(args));

            writer.Flush();
        }

        private static int Solve(string[] args)
        {
            int a = Next();
            int b = Next();
            int c = Next();

            a %= b;
            a *= 10;

            var h = new HashSet<int> {a};
            for (int i = 1;; i++)
            {
                while (a < b)
                {
                    a *= 10;
                    if (c == 0)
                        return i;
                    i++;
                }

                int cc = a/b;

                if (cc == c)
                    return i;

                int aa = (a - cc*b)*10;

                if (!h.Add(aa))
                    return -1;

                a = aa;

                if (a == 0)
                {
                    if (c == 0)
                        return i + 1;
                    return -1;
                }
            }
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;

namespace test
{
    class Program
    {
        static void Main()
        {
            string txt;
            while ((txt = Console.ReadLine()) != null)
            {
                var lst = txt.Split(' ');
                var a = int.Parse(lst[0]);
                var b = int.Parse(lst[1]);
                var c = int.Parse(lst[2]);
                var m = a % b;
                var pos = -1;

                if (m == 0)
                {
                    if (c == 0)
                    {
                        pos = 1;
                    }
                }
                else
                {
                    var p = 1;
                    var ms = new List<int>();
                    while (true)
                    {
                        ms.Add(m);
                        m *= 10;
                        var x = m / b;
                        if (x == c)
                        {
                            pos = p;
                            break;
                        }

                        m %= b;
                        if (m == 0)
                        {
                            if (c == 0)
                            {
                                pos = p + 1;
                            }

                            break;
                        }

                        if (ms.Contains(m))
                        {
                            break;
                        }
                        p++;
                    }
                }
                Console.WriteLine(pos);
            }
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Numerics;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
public class CodeForces
{
#if TEST
    // To set this go to Project -> Properties -> Build -> General -> Conditional compilation symbols: -> enter 'TEST' into text box.
    const bool testing = false;
#else
const bool testing = false;
#endif

    private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
    private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c < '0' || c > '9');
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res;
            res *= 10;
            res += c - '0';
        }
    }

    /* Iterative Function to calculate (x^y)%p in O(log y) */
    static long power(long x, long y, long p)
    {
        long res = 1;      // Initialize result

        x = x % p;  // Update x if it is more than or
                    // equal to p

        while (y > 0)
        {
            // If y is odd, multiply x with result
            if ((y & 1) != 0)
                res = (res * x) % p;

            // y must be even now
            y = y >> 1; // y = y/2
            x = (x * x) % p;
        }
        return res;
    }
    static void program(TextReader input)
    {
            var data = input.ReadLine().Split(' ').Select(BigInteger.Parse).ToList();
        var a = data[0];
        var b = data[1];
        var c = data[2];
        a =  a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        var res = a / b;
        var s = res.ToString();
        var s2 = c.ToString();
        var added = 0;
        long h = (long)Math.Floor(((double.Parse(b.ToString()) - 1.0)/ double.Parse(data[0].ToString())))/10;
        while(h > 0)
        {
            added++;
            h /= 10;
        }
        if(added != 0 && c == 0)
        {
            writer.WriteLine(1);
            writer.Flush();
            return;
        }
        var lastZero = s.Length;
        for (var i = 0; i < s.Length; i++)
        {
            if(s[i].ToString() == s2)
            {
                writer.WriteLine(added + i + 1);
                writer.Flush();
                return;
            }
        }
        writer.WriteLine(-1);
        writer.Flush();

    }

    public static void Main(string[] args)
    {
        if (!testing)
        { // set testing to false when submiting to codeforces
            program(Console.In); // write your program in 'program' function (its your new main !)
            return;
        }

        Console.WriteLine("Test Case(1) => expected :");
        Console.WriteLine("3\n");
        Console.WriteLine("Test Case(1) => found    :");
        program(new StringReader("4 2 1\n1 3 5 7\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(2) => expected :");
        Console.WriteLine("4\n");
        Console.WriteLine("Test Case(2) => found    :");
        program(new StringReader("4 2 0\n5 3 1 7\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(3) => expected :");
        Console.WriteLine("25\n");
        Console.WriteLine("Test Case(3) => found    :");
        program(new StringReader("5 3 1\n3 3 3 3 3\n"));
        Console.WriteLine();

    }
}

using System;

namespace CSharp
{
    class _900B
    {
        public static void Main()
        {
            var tokens = Console.ReadLine().Split();

            int a = int.Parse(tokens[0]);
            int b = int.Parse(tokens[1]);
            int c = int.Parse(tokens[2]);

            for (int i = 1; i <= b; i++)
            {
                a %= b;
                a *= 10;

                if (a / b == c)
                {
                    Console.WriteLine(i);
                    return;
                }
            }

            Console.WriteLine(-1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Scanner
{
    private readonly char Separator = ' ';
    private int Index = 0;
    private string[] Line = new string[0];
    public string Next()
    {
        if (Index >= Line.Length)
        {
            Line = Console.ReadLine().Split(Separator);
            Index = 0;
        }
        var ret = Line[Index];
        Index++;
        return ret;
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public string[] StringArray()
    {
        Line = Console.ReadLine().Split(Separator);
        Index = Line.Length;
        return Line;
    }

    public int[] IntArray()
    {
        var l = StringArray();
        var res = new int[l.Length];
        for (int i = 0; i < l.Length; i++)
        {
            res[i] = int.Parse(l[i]);
        }
        return res;
    }

    public long[] LongArray()
    {
        var l = StringArray();
        var res = new long[l.Length];
        for (int i = 0; i < l.Length; i++)
        {
            res[i] = long.Parse(l[i]);
        }
        return res;
    }
}

class Program
{
    private int A, B, C;
    private void Scan()
    {
        var sc = new Scanner();
        A = sc.NextInt();
        B = sc.NextInt();
        C = sc.NextInt();
    }

    public void Solve()
    {
        Scan();
        var b = new bool[100001];
        for (int i = 1; ; i++)
        {
            if(b[A])
            {
                Console.WriteLine(-1);
                return;
            }
            b[A] = true;
            A *= 10;
            if (A / B == C)
            {
                Console.WriteLine(i);
                return;
            }
            A %= B;
        }
    }

    static void Main(string[] args)
    {
        new Program().Solve();
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test
{
    class IOHelper : IDisposable
    {
        StreamReader reader;
        StreamWriter writer;

        public IOHelper(string inputFile, string outputFile, Encoding encoding)
        {
            StreamReader iReader;
            StreamWriter oWriter;
            if (inputFile == null)
                iReader = new StreamReader(Console.OpenStandardInput(), encoding);
            else
                iReader = new StreamReader(inputFile, encoding);

            if (outputFile == null)
                oWriter = new StreamWriter(Console.OpenStandardOutput(), encoding);
            else
                oWriter = new StreamWriter(outputFile, false, encoding);

            reader = iReader;
            writer = oWriter;

            curLine = new string[] { };
            curTokenIdx = 0;
        }

        string[] curLine;
        int curTokenIdx;

        char[] whiteSpaces = new char[] { ' ', '\t', '\r', '\n' };

        public string ReadNextToken()
        {
            if (curTokenIdx >= curLine.Length)
            {
                //Read next line
                string line = reader.ReadLine();
                if (line != null)
                    curLine = line.Split(whiteSpaces, StringSplitOptions.RemoveEmptyEntries);
                else
                    curLine = new string[] { };
                curTokenIdx = 0;
            }

            if (curTokenIdx >= curLine.Length)
                return null;

            return curLine[curTokenIdx++];
        }

        public int ReadNextInt()
        {
            return int.Parse(ReadNextToken());
        }

        public double ReadNextDouble()
        {
            var nextToken = ReadNextToken();
            var result = 0.0;
            nextToken = nextToken.Replace(".", System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator);
            result = double.Parse(nextToken);
            return result;
        }

        public void Write(string stringToWrite)
        {
            writer.Write(stringToWrite);
        }

        public void WriteLine(string stringToWrite)
        {
            writer.WriteLine(stringToWrite);
        }

        public void WriteLine(double valueToWrite)
        {
            long intPart = (long)valueToWrite;
            double fracPart = valueToWrite - intPart;
            var fracPartStr = fracPart.ToString();
            if (fracPartStr.Length > 1)
                fracPartStr = fracPartStr.Substring(2);
            var strToWrite = string.Format("{0}.{1}", intPart, fracPartStr);
            writer.WriteLine(strToWrite);
        }

        public void Dispose()
        {
            try
            {
                if (reader != null)
                {
                    reader.Dispose();
                }
                if (writer != null)
                {
                    writer.Dispose();
                }
            }
            catch { };
        }

        public void Flush()
        {
            if (writer != null)
            {
                writer.Flush();
            }
        }
    }

    class Program
    {
        protected IOHelper ioHelper;

        int a,b,c;

        public void Solve()
        {
            a = ioHelper.ReadNextInt();
            b = ioHelper.ReadNextInt();
            c = ioHelper.ReadNextInt();

            HashSet<int> reminders = new HashSet<int>();

            int curPos = 1;
            int rez = -1;

            a *= 10;

            do
            {
                if (rez != -1)
                    break;

                if (reminders.Contains(a))
                    break;

                while (a < b)
                {
                    a *= 10;
                    curPos++;
                    if (c == 0)
                    { rez = curPos; break; }
                }

                if (rez != -1)
                    break;

                if (reminders.Contains(a))
                    break;

                reminders.Add(a);
                var vl = a / b;

                int numDig = 0;
                int foundAt = -1;
                int curDigit = 0;
                while(vl > 0)
                {
                    var digit = vl % 10;
                    if (digit == c)
                        foundAt = curDigit;
                    numDig++;
                    vl /= 10;
                }

                if(foundAt != -1)
                {
                    rez = curPos + numDig - foundAt - 1;
                }

                curPos += numDig;

                //curPos++;
                a %= b;
                if (a == 0 && c == 0)
                    rez = curPos;
                else
                    a *= 10;
            } while (a != 0);

            ioHelper.WriteLine(rez.ToString());
            ioHelper.Flush();

            //Console.ReadKey();
        }

        public Program(string inputFile, string outputFile)
        {
            ioHelper = new IOHelper(inputFile, outputFile, Encoding.Default);
            Solve();
            ioHelper.Dispose();
        }

        static void Main(string[] args)
        {
            Program myProgram = new Program(null, null);
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Position_in_Fraction
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            writer.WriteLine(Solve(args));

            writer.Flush();
        }

        private static int Solve(string[] args)
        {
            int a = Next();
            int b = Next();
            int c = Next();

            a %= b;
            a *= 10;

            var h = new HashSet<int> {a};
            for (int i = 1;; i++)
            {
                while (a < b)
                {
                    a *= 10;
                    i++;
                    if (c == 0)
                        return i;
                }

                int cc = a/b;

                if (cc == c)
                    return i;

                int aa = (a - cc*b)*10;

                if (!h.Add(aa))
                    return -1;

                a = aa;

                if (a == 0)
                {
                    if (c == 0)
                        return i + 1;
                    return -1;
                }
            }
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

namespace CodeforcesTemplate
{
    public static class Permutation
    {
        private static bool Next(ref int[] arr)
        {
            int k, j, l;
            for (j = arr.Length - 2; (j >= 0) && (arr[j] >= arr[j + 1]); j--) { }
            if (j == -1)
            {
                arr = arr.OrderBy(c => c).ToArray();
                return false;
            }
            for (l = arr.Length - 1; (arr[j] >= arr[l]) && (l >= 0); l--) { }
            var tmp = arr[j];
            arr[j] = arr[l];
            arr[l] = tmp;
            for (k = j + 1, l = arr.Length - 1; k < l; k++, l--)
            {
                tmp = arr[k];
                arr[k] = arr[l];
                arr[l] = tmp;
            }
            return true;
        }
        public static IEnumerable<int[]> AllPermutations(int[] arr)
        {
            do yield return arr;
            while (Next(ref arr));
        }
    }

    class Program
    {
        private const string FILENAME = "distance4";

        private const string INPUT = FILENAME + ".in";

        private const string OUTPUT = FILENAME + ".out";

        private static Stopwatch _stopwatch = new Stopwatch();

        private static StreamReader _reader = null;
        private static StreamWriter _writer = null;

        private static string[] _curLine;
        private static int _curTokenIdx;

        private static char[] _whiteSpaces = new char[] { ' ', '\t', '\r', '\n' };

        private static string ReadNextToken()
        {
            if (_curTokenIdx >= _curLine.Length)
            {
                //Read next line
                string line = _reader.ReadLine();
                if (line != null)
                    _curLine = line.Split(_whiteSpaces, StringSplitOptions.RemoveEmptyEntries);
                else
                    _curLine = new string[] { };
                _curTokenIdx = 0;
            }

            if (_curTokenIdx >= _curLine.Length)
                return null;

            return _curLine[_curTokenIdx++];
        }

        private static int ReadNextInt()
        {
            return int.Parse(ReadNextToken());
        }

        private static void RunTimer()
        {
#if (DEBUG)

            _stopwatch.Start();

#endif
        }

        private static void Main(string[] args)
        {

#if (DEBUG)
            double before = GC.GetTotalMemory(false);
#endif

            string[] sp = Console.ReadLine().Split();

            int[] a = new int[3];

            for (int i = 0; i < 3; ++i)
            {
                a[i] = int.Parse(sp[i]);
            }

            HashSet<int> hashSet = new HashSet<int>();

            a[0] %= a[1];
            int d = -1;
            int pos = 0;
            while (a[0] != 0 && (!hashSet.Contains(a[0])))
            {
                hashSet.Add(a[0]);
                a[0] *= 10;
                d = a[0] / a[1];
                if (d == a[2])
                {
                    break;
                }

                ++pos;
                a[0] %= a[1];
            }

            Console.WriteLine((d == a[2] || a[0] == a[2]) ? pos : -1);

#if (DEBUG)
            _stopwatch.Stop();

            double after = GC.GetTotalMemory(false);

            double consumedInMegabytes = (after - before) / (1024 * 1024);

            Console.WriteLine($"Time elapsed: {_stopwatch.Elapsed}");

            Console.WriteLine($"Consumed memory (MB): {consumedInMegabytes}");

            Console.ReadKey();
#endif

        }

        private static int CountLeadZeros(string source)
        {
            int countZero = 0;

            for (int i = source.Length - 1; i >= 0; i--)
            {
                if (source[i] == '0')
                {
                    countZero++;
                }

                else
                {
                    break;
                }

            }

            return countZero;
        }

        private static string ReverseString(string source)
        {
            char[] reverseArray = source.ToCharArray();

            Array.Reverse(reverseArray);

            string reversedString = new string(reverseArray);

            return reversedString;
        }

        private static int[] CopyOfRange(int[] src, int start, int end)
        {
            int len = end - start;
            int[] dest = new int[len];
            Array.Copy(src, start, dest, 0, len);
            return dest;
        }

        private static string StreamReader()
        {

            if (_reader == null)
                _reader = new StreamReader(INPUT);
            string response = _reader.ReadLine();
            if (_reader.EndOfStream)
                _reader.Close();
            return response;

        }

        private static void StreamWriter(string text)
        {

            if (_writer == null)
                _writer = new StreamWriter(OUTPUT);
            _writer.WriteLine(text);

        }

        private static int BFS(int start, int end, int[,] arr)
        {
            Queue<KeyValuePair<int, int>> queue = new Queue<KeyValuePair<int, int>>();
            List<bool> visited = new List<bool>();
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                visited.Add(false);
            }

            queue.Enqueue(new KeyValuePair<int, int>(start, 0));
            KeyValuePair<int, int> node;
            int level = 0;
            bool flag = false;

            while (queue.Count != 0)
            {
                node = queue.Dequeue();
                if (node.Key == end)
                {
                    return node.Value;
                }
                flag = false;
                for (int i = 0; i < arr.GetLength(0); i++)
                {

                    if (arr[node.Key, i] == 1)
                    {
                        if (visited[i] == false)
                        {
                            if (!flag)
                            {
                                level = node.Value + 1;
                                flag = true;
                            }
                            queue.Enqueue(new KeyValuePair<int, int>(i, level));
                            visited[i] = true;
                        }
                    }
                }

            }
            return 0;

        }

        private static void Write(string source)
        {
            File.WriteAllText(OUTPUT, source);
        }

        private static string ReadString()
        {
            return File.ReadAllText(INPUT);
        }

        private static void WriteStringArray(string[] source)
        {
            File.WriteAllLines(OUTPUT, source);
        }

        private static string[] ReadStringArray()
        {
            return File.ReadAllLines(INPUT);
        }

        private static int[] GetIntArray()
        {
            return ReadString().Split(' ').Select(int.Parse).ToArray();
        }

        private static double[] GetDoubleArray()
        {
            return ReadString().Split(' ').Select(double.Parse).ToArray();
        }

        private static int[,] ReadINT2XArray(List<string> lines)
        {
            int[,] arr = new int[lines.Count, lines.Count];

            for (int i = 0; i < lines.Count; i++)
            {
                int[] row = lines[i].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

                for (int j = 0; j < lines.Count; j++)
                {
                    arr[i, j] = row[j];
                }
            }

            return arr;
        }
    }
}

using System;
using System.Linq;

namespace test
{
    class Program
    {
        static void Main()
        {
            string txt;
            while ((txt = Console.ReadLine()) != null)
            {
                var lst = txt.Split(' ').Select(int.Parse).ToList();
                var end = lst.Count - 2;
                var pos = -1;
                for (int i = 0; i < end; i++)
                {
                    var b = lst[i + 1];
                    if (b == 0)
                    {
                        continue;
                    }
                    var a = lst[i];
                    var p = i + 2;
                    var c = lst[i + p];
                    var x = a % b;
                    if (x == 0 && c == 0)
                    {
                        pos = p;
                    }
                    else
                    {
                        var t = (x / b).ToString();
                        if (t.Length > 5)
                        {
                            if (t[5] == c)
                            {
                                pos = p;
                                break;
                            }
                        }
                        else if (c == 0)
                        {
                            pos = p;
                            break;
                        }
                    }
                }
                Console.WriteLine(pos);
            }
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
public class CodeForces
{
#if TEST
    // To set this go to Project -> Properties -> Build -> General -> Conditional compilation symbols: -> enter 'TEST' into text box.
    const bool testing = false;
#else
const bool testing = false;
#endif

    private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
    private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c < '0' || c > '9');
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res;
            res *= 10;
            res += c - '0';
        }
    }

    /* Iterative Function to calculate (x^y)%p in O(log y) */
    static long power(long x, long y, long p)
    {
        long res = 1;      // Initialize result

        x = x % p;  // Update x if it is more than or
                    // equal to p

        while (y > 0)
        {
            // If y is odd, multiply x with result
            if ((y & 1) != 0)
                res = (res * x) % p;

            // y must be even now
            y = y >> 1; // y = y/2
            x = (x * x) % p;
        }
        return res;
    }
    static void program(TextReader input)
    {
            var data = input.ReadLine().Split(' ').Select(long.Parse).ToList();
        var a = data[0];
        var b = data[1];
        var c = data[2];
        a *= 10000000000000;
        var res = a / b;
        var s = res.ToString();
        var s2 = c.ToString();
        var added = 0;
        long h = (long)Math.Floor(((b - 1.0)/ data[0]))/10;
        while(h > 0)
        {
            added++;
            h /= 10;
        }
        if(added != 0 && c == 0)
        {
            writer.WriteLine(1);
            writer.Flush();
            return;
        }
        for(var i = 0; i < s.Length; i++)
        {
            if(s[i].ToString() == s2)
            {
                writer.WriteLine(added + i + 1);
                writer.Flush();
                return;
            }
        }
        writer.WriteLine(-1);
        writer.Flush();

    }

    public static void Main(string[] args)
    {
        if (!testing)
        { // set testing to false when submiting to codeforces
            program(Console.In); // write your program in 'program' function (its your new main !)
            return;
        }

        Console.WriteLine("Test Case(1) => expected :");
        Console.WriteLine("3\n");
        Console.WriteLine("Test Case(1) => found    :");
        program(new StringReader("4 2 1\n1 3 5 7\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(2) => expected :");
        Console.WriteLine("4\n");
        Console.WriteLine("Test Case(2) => found    :");
        program(new StringReader("4 2 0\n5 3 1 7\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(3) => expected :");
        Console.WriteLine("25\n");
        Console.WriteLine("Test Case(3) => found    :");
        program(new StringReader("5 3 1\n3 3 3 3 3\n"));
        Console.WriteLine();

    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Numerics;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
public class CodeForces
{
#if TEST
    // To set this go to Project -> Properties -> Build -> General -> Conditional compilation symbols: -> enter 'TEST' into text box.
    const bool testing = false;
#else
const bool testing = false;
#endif

    private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
    private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c < '0' || c > '9');
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res;
            res *= 10;
            res += c - '0';
        }
    }

    /* Iterative Function to calculate (x^y)%p in O(log y) */
    static long power(long x, long y, long p)
    {
        long res = 1;      // Initialize result

        x = x % p;  // Update x if it is more than or
                    // equal to p

        while (y > 0)
        {
            // If y is odd, multiply x with result
            if ((y & 1) != 0)
                res = (res * x) % p;

            // y must be even now
            y = y >> 1; // y = y/2
            x = (x * x) % p;
        }
        return res;
    }
    static void program(TextReader input)
    {
            var data = input.ReadLine().Split(' ').Select(BigInteger.Parse).ToList();
        var a = data[0];
        var b = data[1];
        var c = data[2];
        a =  a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        var res = a / b;
        var s = res.ToString();
        var s2 = c.ToString();
        var added = 0;
        long h = (long)Math.Floor(((double.Parse(b.ToString()) - 1.0)/ double.Parse(data[0].ToString())))/10;
        while(h > 0)
        {
            added++;
            h /= 10;
        }
        if(added != 0 && c == 0)
        {
            writer.WriteLine(1);
            writer.Flush();
            return;
        }
        for(var i = 0; i < s.Length; i++)
        {
            if(s[i].ToString() == s2)
            {
                writer.WriteLine(added + i + 1);
                writer.Flush();
                return;
            }
        }
        writer.WriteLine(-1);
        writer.Flush();

    }

    public static void Main(string[] args)
    {
        if (!testing)
        { // set testing to false when submiting to codeforces
            program(Console.In); // write your program in 'program' function (its your new main !)
            return;
        }

        Console.WriteLine("Test Case(1) => expected :");
        Console.WriteLine("3\n");
        Console.WriteLine("Test Case(1) => found    :");
        program(new StringReader("4 2 1\n1 3 5 7\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(2) => expected :");
        Console.WriteLine("4\n");
        Console.WriteLine("Test Case(2) => found    :");
        program(new StringReader("4 2 0\n5 3 1 7\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(3) => expected :");
        Console.WriteLine("25\n");
        Console.WriteLine("Test Case(3) => found    :");
        program(new StringReader("5 3 1\n3 3 3 3 3\n"));
        Console.WriteLine();

    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
public class CodeForces
{
#if TEST
    // To set this go to Project -> Properties -> Build -> General -> Conditional compilation symbols: -> enter 'TEST' into text box.
    const bool testing = false;
#else
const bool testing = false;
#endif

    private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
    private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c < '0' || c > '9');
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res;
            res *= 10;
            res += c - '0';
        }
    }

    /* Iterative Function to calculate (x^y)%p in O(log y) */
    static long power(long x, long y, long p)
    {
        long res = 1;      // Initialize result

        x = x % p;  // Update x if it is more than or
                    // equal to p

        while (y > 0)
        {
            // If y is odd, multiply x with result
            if ((y & 1) != 0)
                res = (res * x) % p;

            // y must be even now
            y = y >> 1; // y = y/2
            x = (x * x) % p;
        }
        return res;
    }
    static void program(TextReader input)
    {
            var data = input.ReadLine().Split(' ').Select(long.Parse).ToList();
        var a = data[0];
        var b = data[1];
        var c = data[2];
        a *= 10000000000000;
        var res = a / b;
        var s = res.ToString();
        var s2 = c.ToString();
        var added = 0;
        var h = (b - 1)/10;
        while(h > 0)
        {
            added++;
            h /= 10;
        }
        if(added != 0 && c == 0)
        {
            writer.WriteLine(1);
            writer.Flush();
            return;
        }
        for(var i = 0; i < s.Length; i++)
        {
            if(s[i].ToString() == s2)
            {
                writer.WriteLine(added + i + 1);
                writer.Flush();
                return;
            }
        }
        writer.WriteLine(-1);
        writer.Flush();

    }

    public static void Main(string[] args)
    {
        if (!testing)
        { // set testing to false when submiting to codeforces
            program(Console.In); // write your program in 'program' function (its your new main !)
            return;
        }

        Console.WriteLine("Test Case(1) => expected :");
        Console.WriteLine("3\n");
        Console.WriteLine("Test Case(1) => found    :");
        program(new StringReader("4 2 1\n1 3 5 7\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(2) => expected :");
        Console.WriteLine("4\n");
        Console.WriteLine("Test Case(2) => found    :");
        program(new StringReader("4 2 0\n5 3 1 7\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(3) => expected :");
        Console.WriteLine("25\n");
        Console.WriteLine("Test Case(3) => found    :");
        program(new StringReader("5 3 1\n3 3 3 3 3\n"));
        Console.WriteLine();

    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Numerics;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
public class CodeForces
{
#if TEST
    // To set this go to Project -> Properties -> Build -> General -> Conditional compilation symbols: -> enter 'TEST' into text box.
    const bool testing = false;
#else
const bool testing = false;
#endif

    private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
    private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c < '0' || c > '9');
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res;
            res *= 10;
            res += c - '0';
        }
    }

    /* Iterative Function to calculate (x^y)%p in O(log y) */
    static long power(long x, long y, long p)
    {
        long res = 1;      // Initialize result

        x = x % p;  // Update x if it is more than or
                    // equal to p

        while (y > 0)
        {
            // If y is odd, multiply x with result
            if ((y & 1) != 0)
                res = (res * x) % p;

            // y must be even now
            y = y >> 1; // y = y/2
            x = (x * x) % p;
        }
        return res;
    }
    static void program(TextReader input)
    {
            var data = input.ReadLine().Split(' ').Select(BigInteger.Parse).ToList();
        var a = data[0];
        var b = data[1];
        var c = data[2];
        a =  a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        var res = a / b;
        var s = res.ToString();
        var s2 = c.ToString();
        var added = 0;
        long h = (long)Math.Floor(((double.Parse(b.ToString()) - 1.0)/ double.Parse(data[0].ToString())))/10;
        while(h > 0)
        {
            added++;
            h /= 10;
        }
        if(added != 0 && c == 0)
        {
            writer.WriteLine(1);
            writer.Flush();
            return;
        }
        for(var i = 0; i < s.Length; i++)
        {
            if(s[i].ToString() == s2)
            {
                writer.WriteLine(added + i + 1);
                writer.Flush();
                return;
            }
        }
        writer.WriteLine(-1);
        writer.Flush();

    }

    public static void Main(string[] args)
    {
        if (!testing)
        { // set testing to false when submiting to codeforces
            program(Console.In); // write your program in 'program' function (its your new main !)
            return;
        }

        Console.WriteLine("Test Case(1) => expected :");
        Console.WriteLine("3\n");
        Console.WriteLine("Test Case(1) => found    :");
        program(new StringReader("4 2 1\n1 3 5 7\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(2) => expected :");
        Console.WriteLine("4\n");
        Console.WriteLine("Test Case(2) => found    :");
        program(new StringReader("4 2 0\n5 3 1 7\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(3) => expected :");
        Console.WriteLine("25\n");
        Console.WriteLine("Test Case(3) => found    :");
        program(new StringReader("5 3 1\n3 3 3 3 3\n"));
        Console.WriteLine();

    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Numerics;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
public class CodeForces
{
#if TEST
    // To set this go to Project -> Properties -> Build -> General -> Conditional compilation symbols: -> enter 'TEST' into text box.
    const bool testing = false;
#else
const bool testing = false;
#endif

    private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
    private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c < '0' || c > '9');
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res;
            res *= 10;
            res += c - '0';
        }
    }

    /* Iterative Function to calculate (x^y)%p in O(log y) */
    static long power(long x, long y, long p)
    {
        long res = 1;      // Initialize result

        x = x % p;  // Update x if it is more than or
                    // equal to p

        while (y > 0)
        {
            // If y is odd, multiply x with result
            if ((y & 1) != 0)
                res = (res * x) % p;

            // y must be even now
            y = y >> 1; // y = y/2
            x = (x * x) % p;
        }
        return res;
    }
    static void program(TextReader input)
    {
            var data = input.ReadLine().Split(' ').Select(BigInteger.Parse).ToList();
        var a = data[0];
        var b = data[1];
        var c = data[2];
        a =  a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        a = a * new BigInteger(1000000000000000);
        var res = a / b;
        var s = res.ToString();
        var s2 = c.ToString();
        var added = 0;
        long h = (long)Math.Floor(((double.Parse(b.ToString()) - 1.0)/ double.Parse(data[0].ToString())))/10;
        while(h > 0)
        {
            added++;
            h /= 10;
        }
        if(added != 0 && c == 0)
        {
            writer.WriteLine(1);
            writer.Flush();
            return;
        }
        var lastZero = s.Length;
        for (var i = s.Length-1; i >= 0; i--)
        {
            if (s[i] != '0')
            {
                break;
            }
            lastZero = i;
        }
        for (var i = 0; i < s.Length; i++)
        {
            if(lastZero ==i && s2 == "0")
            {
                break;
            }
            if(s[i].ToString() == s2)
            {
                writer.WriteLine(added + i + 1);
                writer.Flush();
                return;
            }
        }
        writer.WriteLine(-1);
        writer.Flush();

    }

    public static void Main(string[] args)
    {
        if (!testing)
        { // set testing to false when submiting to codeforces
            program(Console.In); // write your program in 'program' function (its your new main !)
            return;
        }

        Console.WriteLine("Test Case(1) => expected :");
        Console.WriteLine("3\n");
        Console.WriteLine("Test Case(1) => found    :");
        program(new StringReader("4 2 1\n1 3 5 7\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(2) => expected :");
        Console.WriteLine("4\n");
        Console.WriteLine("Test Case(2) => found    :");
        program(new StringReader("4 2 0\n5 3 1 7\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(3) => expected :");
        Console.WriteLine("25\n");
        Console.WriteLine("Test Case(3) => found    :");
        program(new StringReader("5 3 1\n3 3 3 3 3\n"));
        Console.WriteLine();

    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
public class CodeForces
{
#if TEST
    // To set this go to Project -> Properties -> Build -> General -> Conditional compilation symbols: -> enter 'TEST' into text box.
    const bool testing = false;
#else
const bool testing = false;
#endif

    private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
    private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c < '0' || c > '9');
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res;
            res *= 10;
            res += c - '0';
        }
    }

    /* Iterative Function to calculate (x^y)%p in O(log y) */
    static long power(long x, long y, long p)
    {
        long res = 1;      // Initialize result

        x = x % p;  // Update x if it is more than or
                    // equal to p

        while (y > 0)
        {
            // If y is odd, multiply x with result
            if ((y & 1) != 0)
                res = (res * x) % p;

            // y must be even now
            y = y >> 1; // y = y/2
            x = (x * x) % p;
        }
        return res;
    }
    static void program(TextReader input)
    {
            var data = input.ReadLine().Split(' ').Select(long.Parse).ToList();
        var a = data[0];
        var b = data[1];
        var c = data[2];
        a *= 10000000000000;
        var res = a / b;
        var s = res.ToString();
        var s2 = c.ToString();
        for(var i = 0; i < s.Length; i++)
        {
            if(s[i].ToString() == s2)
            {
                writer.WriteLine(i + 1);
                writer.Flush();
                return;
            }
        }
        writer.WriteLine(-1);
        writer.Flush();

    }

    public static void Main(string[] args)
    {
        if (!testing)
        { // set testing to false when submiting to codeforces
            program(Console.In); // write your program in 'program' function (its your new main !)
            return;
        }

        Console.WriteLine("Test Case(1) => expected :");
        Console.WriteLine("3\n");
        Console.WriteLine("Test Case(1) => found    :");
        program(new StringReader("4 2 1\n1 3 5 7\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(2) => expected :");
        Console.WriteLine("4\n");
        Console.WriteLine("Test Case(2) => found    :");
        program(new StringReader("4 2 0\n5 3 1 7\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(3) => expected :");
        Console.WriteLine("25\n");
        Console.WriteLine("Test Case(3) => found    :");
        program(new StringReader("5 3 1\n3 3 3 3 3\n"));
        Console.WriteLine();

    }
}