Let us call a pair of integer numbers m-perfect, if at least one number in the pair is greater than or equal to m. Thus, the pairs (3, 3) and (0, 2) are 2-perfect while the pair (-1, 1) is not.

Two integers x, y are written on the blackboard. It is allowed to erase one of them and replace it with the sum of the numbers, (x + y).

What is the minimum number of such operations one has to perform in order to make the given pair of integers m-perfect?


-----Input-----

Single line of the input contains three integers x, y and m ( - 10^18 ≤ x, y, m ≤ 10^18).

Please, do not use the %lld specifier to read or write 64-bit integers in C++. It is preffered to use the cin, cout streams or the %I64d specifier.


-----Output-----

Print the minimum number of operations or "-1" (without quotes), if it is impossible to transform the given pair to the m-perfect one.


-----Examples-----
Input
1 2 5

Output
2

Input
-1 4 15

Output
4

Input
0 -1 5

Output
-1



-----Note-----

In the first sample the following sequence of operations is suitable: (1, 2) $\rightarrow$ (3, 2) $\rightarrow$ (5, 2).

In the second sample: (-1, 4) $\rightarrow$ (3, 4) $\rightarrow$ (7, 4) $\rightarrow$ (11, 4) $\rightarrow$ (15, 4).

Finally, in the third sample x, y cannot be made positive, hence there is no proper sequence of operations.

Difficulty: competition

Starter code:

Solutions:
k = 0
x, y, m = map(int, input().split())
if (y < x):
    x, y = y, x
if (y >= m):
    print(0)
else:
    if (x <= 0) and (y <= 0):
        print(-1)
    else:
        if (x <= 0) and (y > 0):
            if (abs(x) % y > 0):
                k += abs(x) // y + 1
            else:
                k += abs(x) // y
            x = x + y * k
        a = 0
        b = 1
        c = 0
        while (c < 5000000000000000000):
            if (a * x + b * y >= m):
                print(k)
                break
            c = a + b
            a = b
            b = c
            k += 1
        if (c >= 5000000000000000000):
            print(-1)

def doit():
    x, y, m = [int(k) for k in input().strip().split()]
    if x < y:
        x, y = y, x
    if x >= m:
        print(0)
        return

    if x<=0 and y<=0:
        print(-1)
        return

    k = 0
    if y < 0:
        k = (-y+x-1)//x
        y += k*x
        assert(y >= 0)
    if x < y:
        x, y = y, x
        
    while x < m:
        k += 1
        x, y = x+y, x
        if x < y:
            x, y = y, x
    print(k)

doit()


x, y, m = list(map(int, input().split()))
if max(x, y) >= m:
    print(0)
elif x <= 0 and y <= 0:
    print(-1)
else:   
    if x > y:
        x, y = y, x
    ans, st = 0, 0
    add = 0
    if x <= 0:  
        st = (0 - x + y - 1) // y
        x += y * st
    ans = st + (m - x + y - 1) // y
    while y < m:
        x, y = y, x + y
        add += 1
        ans = min(ans, add + st + (m - x + y - 1) // y)
    ans = min(ans, add + st)
    print(ans)


x, y, m = list(map(int, input().split()))
x, y = min(x, y), max(x, y)
if y >= m:
    print(0)
elif y <= 0:
    print(-1)
else:
    c = 0
    if x <= 0:
        q = (-x + y - 1) // y
        c += q
        x += q * y
    while y < m:
        x, y = y, x + y
        c += 1
    print(c)


x, y, m = list(map(int, input().split()))
x, y = min(x, y), max(x, y)
if y >= m:
    print(0)
elif y <= 0:
    print(-1)
else:
    c = 0
    while y < m:
        q = (2 * y - x) // y
        c += q
        x, y = y, x + q * y
    print(c)


s = input().split()
x, y, m = (int(i) for i in s)

ans = 0

if x >= m or y >= m:
    print(0)
elif x <= 0 and y <= 0:
    print(-1)
else:
    if x < 0:
        q = abs(x // y)
        ans += q
        x += y * q
    elif y < 0:
        q = abs(y // x)
        ans += q
        y += x * q

    while x < m and y < m:
        ans += 1
        if x < y:
            x = x + y
        else:
            y = x + y
    
    print(ans)

#! /usr/bin/env python

def change(x, y):
    if x > y:
        tmp = y
        y = x
        x = tmp
    return (x, y)

x, y, m = [int(x) for x in input().split()]
if x >= m or y >= m:
    ans = 0
elif x <= 0 and y <= 0:
    ans = -1
else:
    ans = 0
    x, y = change(x, y)
    if x < 0:
        ans = int(-x / y)
        ans += 1
        x = y - (-x % y)
    while y < m:
        tmp = x + y
        x = y
        y = tmp
        x, y = change(x, y)
        ans += 1
print(ans)


x, y, m = [int(x) for x in input().split()]
x, y = min(x, y), max(x, y)

if y >= m:
  print(0)
  return

if y <= 0:
  print(-1)
  return

c = 0
if x < 0 and y > 0:
  if m <= 0:
    c = (m - x) // y
  else:
    c = -x // y
  x += c * y

while x < m and y < m:
  xx = x + y
  if xx <= min(x, y):
    print(-1)
    return
  x, y = xx, max(x, y)
  c += 1
print(c)


# -*- coding: utf-8 -*-

def main():
	x, y, m = map(int, input().split())
	b1 = min(x, y)
	b2 = max(x, y)
	count = 0
	if b2 >= m:
		return 0
	if b2 <= 0:
		return -1
	if b1 < 0:
		count = (b2 - b1 + (b2 - 1)) // b2
		b = b2
		b2 = b1 + count * b2
		b1 = b
	while b2 < m:
		b = b1 + b2
		b1 = min(b2, b)
		b2 = max(b2, b)
		count += 1
	return count

def __starting_point():
	print('{:#d}'.format(main()))
__starting_point()

x, y, m = map(int, input().split())

x, y = min(x, y), max(x, y)

if y >= m:
    print(0)
elif y <= 0:
    print(-1)
else:
    c = 0
    while y < m:
        q = (2*y-x) //y
        c += q
        x, y = y, x+q*y
    print(c)

x, y, m = list(map(int, input().split()))
if max(x, y) >= m:
    print(0)
elif m < 0 or max(x, y) <= 0:
    print(-1)
else:
    if x + y < 0:
        cnt = (max(x, y) - min(x, y)) // max(x, y)
        x, y = min(x, y) + max(x, y) * cnt, max(x, y)
    else:
        cnt = 0
    while max(x, y) < m:
        x, y = max(x, y), x + y
        cnt += 1
    print(cnt)


z=[int(p) for p in input().split()]
m=z[2]
lst=[]
lst.append(z[0])
lst.append(z[1])
tempi=min(lst)
tempa=max(lst)

count=0
fibo=[]


n=1000000000000000000
def fib(n):
        
        a, b = 0, 1
        while b < n:
                fibo.append(b)
                a, b = b, a+b
    


def add(m):
        n=10**18
        tempi=min(lst)
        tempa=max(lst)
        count=0
        if(tempi>0 and tempa>0 and m>tempa):
                fib(n)
                for p in range(1,len(fibo)+1):
                        if(((fibo[p]*tempa)+ (fibo[p-1]*tempi))>=m):
                                count+=p
                                return count
        elif(tempi==0 or tempa==0):
                count=1
                fib(n)
                tempi=tempa+(tempi)
                for p in range(1,len(fibo)):
                        if(((fibo[p]*tempa)+ (fibo[p-1]*tempi))>=m):
                                count+=p
                                return count

        elif(tempi<0 and tempa>0):
                val=(-(tempi)//tempa)+1
                count=val
                tempi=tempi+(val*tempa)
                fib(n)
                for p in range(1,len(fibo)):
                        if(((fibo[p]*tempa)+ (fibo[p-1]*tempi))>=m):
                                count+=p
                                return count

        





if(tempi>0 and tempa>0 and m>tempa):
        cou=add(m)
        print(cou)

elif(tempi>0 and tempa>0 and m<=tempa):
        print(0)

elif(tempi==0 ):
        if(tempi==0 and tempa==0 and m>0):
                print(-1)
        elif(tempi==0 and tempa==0 and m<=0):
                print(0)
        elif(tempa==0 and tempi<0 and m>0):
                print(-1)
                
        else:
                cou=add(m)
                print(cou)
elif(tempi<0 and tempa>0):
        if(m<=tempa):
                print(0)
        else:
                cou=add(m)
                print(cou)
elif(tempi<0 and tempa==0):
        if(m>0):
                print(-1)
        else:
                print(0)
elif(tempi<0 and tempa<0):
        if(m>=0):
                print(-1)
        elif(m<0 and m<=tempa):
                print(0)
        elif(m<0 and m>tempa):
                print(-1)

        


        
                
                
                        
                        
                                
                        
                


                        
                        
                        


x, y, m = map(int, input().split())
if x < y: x, y = y, x
if x >= m: print(0)
elif x > 0:
    s = 0
    if y < 0:
        s = (-y) // x + 1
        y += x * s
    while x < m:
        x, y = x + y, x
        s += 1
    print(s)
elif x < m: print(-1)
else: print(0)

def Solve():
    x,y,m=list(map(int,input().split()))

    if(x>=m or y>=m):
        return 0

    if(x<=0 and y<=0):
        return -1
    ans=0
    if(y<=0):
        ans=abs(y)//x+1
        y+=ans*x

    elif(x<=0):
        ans=abs(x)//y+1
        x+=ans*y

    while(x<m and y<m):
        if(x<y):
            x+=y
        else:
            y+=x
        ans+=1

    return ans
print(Solve())


from sys import stdin

__author__ = 'artyom'


def read_next_line():
  return list(map(int, stdin.readline().strip().split()))


x, y, m = read_next_line()
a = [x, y]
x = min(a)
y = max(a)
if y <= 0 and m > y:
  print(-1)
else:
  count = 0
  if x < 0 and m > y:
    count = -(x // y)
    x = x % y
  while m > y:
    tmp = y
    y = x + y
    x = tmp
    count += 1
  print(count)

x, y, m = map(int, input().split())
if x < y: x, y = y, x
if x >= m: print(0)
elif x > 0:
    s = 0
    if y < 0:
        s = (-y) // x + 1
        y += x * s
    while x < m:
        x, y = x + y, x
        s += 1
    print(s)
elif x < m: print(-1)
else: print(0)

x, y, m = map(int, input().split())
if max(x, y) >= m:
    print(0)
elif max(x, y) <= 0:
    print(-1)
else:
    p, val = sorted([x, y]), 0
    if p[0] < 0:
        s = (min(m, 0) - p[0]) // p[1]
        p[0] += s * p[1]
        val += s
    while max(p) < m:
        p, val = [sum(p), max(p)], val + 1
    print(val)

x, y, m = (int(q) for q in input().split())
if x >= m or y >= m:
	print(0)
	return
if x <= 0 and y <= 0:
	print(-1)
	return
ans = 0
if x < 0:
	ans += -x // y
	x += -x // y * y
if y < 0:
	ans += -y // x
	y += -y // x * x
while x < m and y < m:
	ans += 1
	if x < y:
		x += y
	else:
		y += x
print(ans)


#!/usr/bin/env python3
x, y, m = list(map(int,input().split()))
if not (x < y):
    x, y = y, x
if m <= y:
    print(0)
elif y <= 0:
    print(-1)
else:
    i = 0
    if x < 0:
        j = - (x // y)
        x += j * y
        i += j
    while y < m:
        x, y = y, x + y
        i += 1
    print(i)


x, y, xx = map(int, input().split())
cnt = 0
while max(x, y) < xx:
    if x < y:
        x, y = y, x
    l, r, m = 0, 4 * 10 ** 18, 0
    while r > l + 1:
        m = (l + r) // 2;
        if x >= m * x + y:
            l = m
        else:
            r = m
    if r == 4e18:
        print(-1)
        return
    cnt += r
    temp = x
    x = r * x + y
    y = temp
print(cnt)

#!/usr/bin/env python3

x, y, m = list(map(int, input().split()))
result = 0
if x <= 0 and y <= 0:
    if x < m and y < m:
        print(-1)
    else:
        print(0)
    return

while x < m and y < m:
    x, y = (y, x) if x > y else (x, y)
    tmp = (2 * y - x - 1) // y
    if tmp == 0:
        tmp = 1
    result += tmp
    x = x + tmp * y
print(result)


def main():
    a, b, m = list(map(int, input().split()))
    if a > b:
        a, b = b, a
    if m <= b:
        print(0)
        return
    if b <= 0:
        print(-1)
        return
    i = max((b - a) // b, 0)
    a += b * i
    while b < m:
        a, b, i = b, a + b, i + 1
    print(i)


def __starting_point():
    main()

__starting_point()

def ag():
  a,b,m = list(map(int,input().split()))
  x = min(a,b)
  y = max(a,b)
  res = 0
  if x >= m or y >= m:
    return 0
  elif y<=0:
    return "-1"
  if x<0:
    res += int((abs(x)+y-1)/y)
    x += y*res
 
  while y < m:
    x1 = y 
    y = y + x
    x = x1
    res += 1
  return res
print(ag())


x, y, m = map(int, input().split())
if x > y:
  x, y = y, x
if y >= m:
  print(0)
  return
if y <= 0:
  print(-1)
  return
anw = 0

if x < 0:
  anw += abs(x)//y
  x += (abs(x)//y)*y
#print("anw aft", anw, x)
while max(x, y) < m:
  if x > y:
    x, y = y, x
  x = y+x
  anw += 1
print(anw)

x,y,m = list(map(int,input().split()))
if(x > y):
	x,y = y,x
if(y >= m):
	print('0')
elif(x+y <= x):
	print('-1')
else:
	ans = (y-x+y-1)//y
	x += y*ans
	while(x < m):
		x,y = x+y,x
		ans += 1
	print(ans)