#include<stdio.h>
#include<string.h>
int main()
{
	long long int x,y,m,cnt=0;
	scanf("%lld",&x);
	scanf("%lld",&y);
	scanf("%lld",&m);
	if(x>=m || y>=m)
	{
		printf("%d\n",0);
		return 0;
	}
	if(x<=0 && y<=0)
	{
		printf("%d\n",-1);
		return 0;
	}
	if(x>y)
	{
		long long int tmp = x;
		x=y;
		y=tmp;
	}
	if(x<0)
	{
		cnt += -x/y;
		x+=y * cnt;
	}
	while(x<m && y<m)
	{
		if(x<y){
			x+=y;cnt++;}
		else{
			y+=x;cnt++;}
	}
	printf("%lld\n",cnt);
	return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{long long int x,y,m,i=0;
    scanf("%I64d%I64d%I64d",&x,&y,&m);
    while(1)
    {
    if(x>=m||y>=m)
    {
    printf("%I64d",i);break;}
    if(x+y<=x&&x+y<=y)
    {
    printf("-1");break;}
    if(x>0&&y<0)
    {
    i=ceil((-y+x-1)/x);
    y=y+x*i;
    continue;
    }
    if(y>0&&x<0)
    {
    i=ceil((-x+y-1)/y);
    x=x+y*i;
    continue;
    }
    if(x>y)
    y=x+y;
    else
    x=x+y;
    i++;
}
return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

int main(int argc, const char *argv[])
{
  long long x, y, m;
  assert(scanf("%lld %lld %lld", &x, &y, &m) == 3);

  if (x <= 0 && y <= 0) {
    if (x < m && y < m) {
      printf("-1\n");
      return 0;
    }
    else {
      printf("0\n");
      return 0;
    }
  }

  if (x >= m || y >= m) {
    printf("0\n");
    return 0;
  }

  long long s, t, m2;
  long long count = 0;

  if (m > 0) { m2 = 0; }
  else { m2 = m; }

  if (x <= 0) {
    t = (m2 - x) / y;
    count += t;
    x += y*t;
  }

  if (y <= 0) {
    t = (m2 - y) / x;
    count += t;
    y += x*t;
  }

  while (x < m && y < m) {
    s = x + y;
    if (x < y) { x = s; }
    else { y = s; }
    count++;
  }

  printf("%lld\n", count);
  return 0;
}

#include <stdio.h>

int main() {
    long long x, y, m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);
    if (x >= m || y >= m) {
        printf("0");
        return 0;
    }
    if (x <= 0 && y <= 0) {
        printf("-1");
        return 0;
    }
    long long s = 0;
    if (x > y) {
        int t = x;
        x = y;
        y = t;
    }
    while (y < m) {
        long long d = y - x;
        long long t = d / y;
        if (x + y * t <= y)
            t++;
        x += y * t;
        s += t;
        t = x;
        x = y;
        y = t;
    }
    printf("%I64d", s);
    return 0;
}

#include <stdio.h>

int main()
{
    long long x, y, m, sum = 0;

    scanf("%I64d %I64d %I64d", &x, &y, &m);

    if (x >= m || y >= m) {
        puts("0");

        return 0;
    }

    if (x <= 0 && y <= 0) {
        puts("-1");

        return 0;
    }

    if (x > y) {
        long long tmp = x;
        x = y;
        y = tmp;
    }

    if (x < 0) {
        sum += -x / y;

        x += y * sum;
    }

    while (x < m && y < m) {
        if (x < y) {
            x += y;
        } else {
            y += x;
        }

        sum++;
    }

    printf("%I64d\n", sum);

    return 0;
}

#include<stdio.h>
int main()
{
	long long int a,b,x,p,q,c,y,temp;
	scanf("%I64d %I64d %I64d",&a,&b,&x);
	if(a>b)
	{
		temp=b;
		b=a;
		a=temp;
	}
	if(b>=x)
	printf("0");
	else
	{
		if(a<=0 && b<=0)
		printf("-1");
		else
		{
			c=0;
			if(a<0)
			{
				p=-1*a;
				if(p%b==0)
				{
					c=c+p/b;
					a=0;
				}
				else
				{
					q=p/b;
					q++;
					c=c+q;
					a=a+q*b;
				}
				if(a>b)
				{
					temp=b;
					b=a;
					a=temp;
				}
			}
			while(b<x)
			{
				c++;
				p=b;
				q=a+b;
				a=p;
				b=q;
				if(a>b)
				{
					temp=b;
					b=a;
					a=temp;
				}
				//printf("%I64d %I64d %I64d\n",a,b,c);
			}
			printf("%I64d",c);
		}
	}
	return 0;
}

#include <stdio.h>

typedef long long LL_t;

int main()
{
	LL_t x,y,m,temp,Cnt;
	while(scanf("%I64d %I64d %I64d",&x,&y,&m)!=EOF)
	{
		if(x<y)
		{
			temp=x;
			x=y;
			y=temp;
		}
		if(x>=m)
		{
			printf("0\n");
			continue;
		}
		if(x<=0)
		{
			printf("-1\n");
			continue;
		}
		if(y<0)
		{
			y=-y;
			if(y%x!=0)
			{
				Cnt=y/x+1;
				y=x-y%x;
			}
			else
			{
				Cnt=y/x;
				y=0;
			}
		}
		else
		{
			Cnt=0;
		}
		while(1)
		{
			++Cnt;
			temp=x+y;
			y=temp;
			if(temp>=m)
			{
				printf("%I64d\n",Cnt);
				break;
			}
			temp=x;
			x=y;
			y=temp;
		}
	}
	return 0;
}

#include <stdio.h>

int main()
{
	long long int a, b, m;
	long long int count;
	scanf("%lld", &a);
	scanf("%lld", &b);
	scanf("%lld", &m);

	if (a>=m || b>=m)
	{
		count = 0;
		printf("%lld\n", count);
		return 0;
	}

	if((a<=0 && b<=0))
	{
		count = -1;
		printf("%lld\n", count);
		return 0;
	}
	count = 0;

	if (a<0)
	{
		count = (-1*a)/b;
		a = b*count + a;
	}
	if (b<0)
	{
		count = (-1*b)/a;
		b = a*count + b;
	}

	while(a<m && b<m)
	{

		if(a>=b)
		{
			b = a+b;
			count++;
		}
		else
		{
			a = a+b;
			count++;
		}
	}
	printf("%lld\n", count);
	return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main()
{
long long int x,y,m,g=0,s=0,sum=0;
scanf("%I64d%I64d%I64d",&x,&y,&m);
long long  int count=0;
if(x>y)
{
g=x;
s=y;
}
else
{
g=y;
s=x;
}
if(x<=0&&y<=0)
{if(m<=x||m<=y)
printf("0");
else
printf("-1");
exit(0);
}
else
{
if(g>=m)
{
    printf("0");
exit(0);
}

if(s<0)
{
count=(-s)/g +1;
s=s+count*g;
}

while(g<m)
{sum=g+s;
s=g;
g=sum;
count++;
}
}
printf("%I64d",count);
return 0;
}

/* practice with Dukkha */
#include <stdio.h>

int main() {
	long long x, y, z, m, ans;

	scanf("%lld%lld%lld", &x, &y, &m);
	if (x > y)
		z = x, x = y, y = z;
	if (y >= m) {
		printf("0\n");
		return 0;
	}
	if (y <= 0) {
		printf("-1\n");
		return 0;
	}
	ans = 0;
	if (x < 0) {
		ans += (-x + y - 1) / y;
		x = (x % y + y) % y;
	}
	while (y < m) {
		z = x + y, x = y, y = z;
		ans++;
	}
	printf("%lld\n", ans);
	return 0;
}

#include<stdio.h>
int main()
{
    long long int N,i,j,M,a,ans=0;
    scanf("%I64d%I64d%I64d",&N,&M,&a);
    while(N<a&&M<a)
    {
        if(N<=0&&M<=0){ans=-1;break;}
        if(N<0&&M>0)
        {
            ans+=(-N/M)+1;
            N+=(ans*M);
        }
        if(M<0&&N>0)
        {
            ans+=(-M/N)+1;
            M+=(ans*N);
        }
        if(N<M)N=N+M;
        else M=M+N;
        ans++;
    }
    printf("%I64d\n",ans);
    return 0;
}

#include<stdio.h>
#define max(a,b) ((a)>(b)?(a):(b))
int main(void)
{
    long long i,j,k,sum=0,m,n;
    scanf("%I64d%I64d%I64d",&i,&j,&k);
    m=max(i,j);
    n=i+j-m;
    if(m>=k||n>=k)
        printf("0\n");
    else if(m<=0)
        printf("-1\n");
    else
    {
        if(n<0)
        {
            sum=(-n)/m+1;
            n+=sum*m;
        }
        while(m<k)
        {
            m=m+n;
            n=m-n;
            sum++;
        }
        printf("%I64d\n",sum);
    }
    return 0;
}

#include <stdio.h>
#include <conio.h>

typedef long long ll;

ll kqua(ll x, ll y, ll m)
{
    ll tmpx, tmpy, tmp, count = 0, k;
    float d;
    if (x > y){ tmp = x; x = y; y = tmp; }
    if (y >= m) return 0;
    else
    {
        if (x <= 0 && y <= 0) return -1;
        else
        {
            if (x < 0)
            {
                d = -1.0*x / y; k = -x / y;
                if (d == k){ x = 0; count = k; }
                else{ x = x + y*(k + 1); count = k + 1; }
            }
            while (1)
            {
                tmpx = x; tmpy = y;
                x = y; y = tmpx + tmpy;
                count++;
                if (y >= m) return count;
            }
        }
    }
}

int main()
{
    ll x, y, m;
    scanf("%I64d %I64d %I64d", &x, &y, &m);
    printf("%I64d", kqua(x, y, m));

    return 0;
}

/*This is by Technical Bangla from University of Dhaka*/
#include <stdio.h>
#include <math.h>
long double  fib(long double  index)
{long double  r=sqrt(5),phi=(1+r)/2,com_phi=1-phi;return (pow(phi,index)-pow(com_phi,index))/r;}
int main()
{
    long long int a,b,c,count,count1;double sum,low,high;
    while(scanf("%I64d %I64d %I64d",&a,&b,&c)!=EOF)
    {
        if((a>=c)||(b>=c)) printf("%d\n",0);
        else if(a>0||b>0)
        {
            count1=0; a<b?(low=a,high=b):(low=b,high=a);
            if(low<0)
            {if(a<b) {low=(long long int)a%(long long int)b;low+=b;count1=(-a)/b;}else {low=(long long int)b%(long long int)a;low+=a;count1=(-b)/a;}count1=(unsigned long long int)count1;if(low) count1++;}
            for(count=-1,sum=-1000000000000000000.0;sum<c;count++) sum=(round)(low*fib((long double )(count+1))+high*fib((long double )(count+2)));
            count+=count1;
            printf("%I64d\n",count);
        }
        else printf("%d\n",-1);
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
int main ()
{
    long long x, y, m, n, z;
    scanf ("%I64d%I64d%I64d", &x, &y, &m);
    n = 0;
    if (x >= m || y >= m)
    {
        printf ("0\n");
        exit (0);
    }
    if (x <= 0 && y<= 0)
    {
        printf ("-1\n");
        exit (0);
    }
    if (x > y)
    {
        z = x;
        x = y;
        y = z;
    }
    if (x <= 0)
    {
        n -= x / y - 1;
        x -= (x / y - 1) * y ;
    }
    while (y < m)
    {
        z = x + y;
        x = y;
        y = z;
        n++;
    }
    printf ("%I64d\n", n);
    return 0;
}

#include<stdio.h>
#include<inttypes.h>

int main()
{
        int64_t x,y,m,ans = 0,factor,x_prime;
        scanf("%I64d",&x);
        scanf("%I64d",&y);
        scanf("%I64d",&m);
        if (x <= 0 && y <= 0 && m<= 0)
        {
            if (x >= m || y >= m)
            {
                printf("0\n");
            }
            else
                printf("-1\n");
        }
        else if (x <= 0 && y <= 0 && m > 0)
        {
            printf("-1\n");
        }
        else if (x >= 0 && y >= 0 && m < 0)
        {
            printf("0\n");
        }
        else if (x >= 0 && y <= 0 && m <= 0)
        {
            printf("0\n");
        }
        else if (x <= 0 && y >=0 && m <= 0)
        {
            printf("0\n");
        }
        else if (x >= 0 && y > 0 && m >= 0)
        {
            if (x >= m || y >= m)
            {
                printf("0");
            }
            else
            {
                while (x < m && y < m)
                {
                        if(x <= y)
                        {
                                x = x + y;
                                ans++;
                        }
                        else
                        {
                                y = x + y;
                                ans++;
                        }
                }
                printf("%I64d\n",ans);
            }
        }
        else if (x < 0 && y > 0 && m >= 0)
        {
            if (x >= m || y >= m)
            {
                printf("%I64d",ans);
            }
            else
            {
                x_prime = -x;
                factor = x_prime/y;
                x += factor * y;
                ans += factor;
                while (x < m && y < m)
                {
                        if(x <= y)
                        {
                                x = x + y;
                                ans++;
                        }
                        else
                        {
                                y = x + y;
                                ans++;
                        }
                }
                printf("%I64d\n",ans);
            }
        }
        else if (x > 0 && y < 0 && m >= 0)
        {
            if (x >= m || y >= m)
            {
                printf("%I64d",ans);
            }
            else
            {
                x_prime = -y;
                factor = x_prime/x;
                y += factor * x;
                ans += factor;
                while (x < m && y < m)
                {
                        if(x <= y)
                        {
                                x = x + y;
                                ans++;
                        }
                        else
                        {
                                y = x + y;
                                ans++;
                        }
                }
                printf("%I64d\n",ans);
            }
        }
    return 0;
}

#include <stdio.h>

int main()
{
    long long x, y, m;
    long long ans = 0;
    long long tmp;
    scanf("%I64d%I64d%I64d", &x, &y, &m);
    if ( x > y )
    {
        tmp = x;
        x = y;
        y = tmp;
    }
    if ( y >= m )
    {
        printf("0\n");
        return 0;
    }
    if ( x <= 0 && y <= 0 )
    {
        printf("-1\n");
        return 0;
    }
    if ( x < 0 )
    {
        ans += -x/y+1;
        x += ans*y;
    }
    while ( y < m )
    {
        ans++;
        tmp = x+y;
        x = y;
        y = tmp;
    }
    printf("%I64d\n", ans);
    return 0;
}

#include <stdio.h>

int main()
{
    long long x, y, m;
    long long ans = 0;
    long long tmp;
    scanf("%I64d%I64d%I64d", &x, &y, &m);
    if ( x > y )
    {
        tmp = x;
        x = y;
        y = tmp;
    }
    if ( y >= m )
    {
        printf("0\n");
        return 0;
    }
    if ( x <= 0 && y <= 0 && y < m )
    {
        printf("-1\n");
        return 0;
    }
    if ( x < 0 && y > 0 )
    {
        if ( m < 0 )
        {
            ans += -m/y;
            x += -m/y*y;
        }
        else
        {
            ans += -x/y;
            x += -x/y*y;
        }
    }
    while ( y < m )
    {
        ans++;
        tmp = x+y;
        if ( tmp > y )
        {
            x = y;
            y = tmp;
        }
        else
        {
            x = tmp;
        }
    }
    printf("%I64d\n", ans);
    return 0;
}

#include <stdio.h>

int main()
{
    long long x, y, m;
    long long ans = 0;
    long long tmp;
    scanf("%I64d%I64d%I64d", &x, &y, &m);
    if ( x > y )
    {
        tmp = x;
        x = y;
        y = tmp;
    }
    if ( y >= m )
    {
        printf("0\n");
        return 0;
    }
    if ( x <= 0 && y <= 0 )
    {
        printf("-1\n");
        return 0;
    }
    if ( x < 0 )
    {
        ans += -x/y;
        x += -x/y*y;
    }
    while ( y < m )
    {
        ans++;
        tmp = x+y;
        if ( tmp > y )
        {
            x = y;
            y = tmp;
        }
        else
        {
            x = tmp;
        }
    }
    printf("%I64d\n", ans);
    return 0;
}

#include<stdio.h>
#define swap(a,b) {long long int t=a;a=b;b=t;}
#define asd   if(x<y)swap(x,y);
long long int x,y,a,b,m,i,j,d,s,t;
int main() {
    scanf("%lld%lld%lld",&x,&y,&m);
    if(x<y)swap(x,y);
    if(x>=m)printf("0");
    else if(x<=0)printf("-1");
    else
    {
        if(y<=0){s= -y/x+(y%x!=0);y+=s*x;}asd;
        while(x<m)
        {
            s++;y+=x;asd;
        }
        printf("%lld",s);
    }
    return 0;
}

#include <stdio.h>
int main()
{
    long long int a, b, m;
    long long int count;
    scanf("%I64d", &a);
    scanf("%I64d", &b);
    scanf("%I64d", &m);

    if (a>=m || b>=m)
    {
        count = 0;
        printf("%I64d\n", count);
        return 0;
    }

    if((a<=0 && b<=0))
    {
        count = -1;
        printf("%I64d\n", count);
        return 0;
    }
    count = 0;

    if (a<0)
    {
        count = (-1*a)/b;
        a = b*count + a;
    }
    if (b<0)
    {
        count = (-1*b)/a;
        b = a*count + b;
    }

    while(a<m && b<m)
    {

        if(a>=b)
        {
            b = a+b;
            count++;
        }
        else
        {
            a = a+b;
            count++;
        }
    }
    printf("%I64d\n", count);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main(void) {
    long long x, y, m, cnt = 0;
    scanf ("%I64d %I64d %I64d", &x, &y, &m);
    if (x >= m || y >= m) {
        printf("%d", 0);
        exit(0);
    }

    if (x + y <= x && x + y <= y) {
        printf("%d", -1);
        exit(0);
    }
    if (x > y) {
        long long temp = x;
        x = y;
        y = temp;
    }
    if (x < 0 && y > 0) {
        long long n = (-x / y);
        cnt += n;
        x += y * n;
    }
    while (x < m && y < m) {
        cnt++;
        if (x > y)
            y = x + y;
        else
            x = x + y;
    }
    printf("%I64d", cnt);
    return 0;
}

#include<stdio.h>

int main()
{   long long x,y,m;
    long long count=0;
    scanf("%I64d%I64d%I64d",&x,&y,&m);
    if(x>=m || y>=m)
    {
        count = 0;
    }
    else if(x>0 || y>0)
    {
        if(x<0)
        {
            count = (-1)*(x/y);
            x += count*y;
        }
        else if(y<0)
        {
            count = (-1)*(y/x);
            y += count*x;
        }

        while(x<m && y<m)
        {
            if(x<y)
            {
                x += y;
            }
            else
            {
             y += x;
            }
            count++;
        }
}
        else{
            count = -1;
        }

    printf("%I64d",count);
    return 0;
}

/*
Author:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%   LALIT KUNDU      %%%%%%%%
%%%%%%%%   IIIT HYDERABAD   %%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<malloc.h>
#define llu long long int
#define min(a,b)(a>b?b:a)
#define max(a,b)(a<b?b:a)
#define sort(arr,n) qsort(arr,n,sizeof(arr[0]),compare)
#define sd(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define su(n) scanf("%llu",&n)
#define rep(i,start,end) for(i=start; i<end; i++)
#define pdn(n) printf("%d\n",n)
#define pln(n) printf("%lld\n",n)
#define pun(n) printf("%llu\n",n)
#define pd(n) printf("%d",n)
#define pl(n) printf("%lld",n)
#define pu(n) printf("%llu",n)
#define pn printf("\n")
#define ps printf(" ")
int main()
{
    llu i,arr[10000];
    arr[0]=0;
    arr[1]=1;
    arr[2]=1;
    for(i=3; ; i++)
    {
        arr[i]=arr[i-1]+arr[i-2];
        if(arr[i]>1000000000000000000)
            break;
    }
    llu x,y,m;
    scanf("%lld%lld%lld",&x,&y,&m);
    if(x<=0 && y<=0)
    {
        if(x<m && y<m)
            printf("-1");
        else
            printf("0");
    }
    else
    {
        if(x>=m || y>=m)
        {
            printf("0\n");
            return 0;
        }
        else
        {
            if(y<x)
            {
                llu temp;
                temp=x;
                x=y;
                y=temp;
            }
            llu p=0;
            if(x<0)
            {
                p=(llu)ceil(-1.0*x/y);
                x=x+p*y;
            }
            if(x>=m || y>=m)
            {
                printf("%lld\n",p);
                return 0;
            }
            else
            {
                llu la=x+y,lb=y,pa=p+1;
                if(la>=m || lb>=m)
                {
                    printf("%lld\n",pa);
                    return 0;
                }
                else
                {
                    for(i=2; ; i++)
                    {
                        if((x*arr[i]+y*arr[i+1])>=m ||(x*arr[i-1]+y*arr[i])>=m )
                            break;
                        pa++;
                    }
                    la=x+y,lb=x;
                    llu pb=p+1;
                    if(la>=m || lb>=m)
                    {
                        printf("%lld\n",pb);
                        return 0;
                    }
                    for(i=2; ; i++)
                    {
                        if((y*arr[i]+x*arr[i+1])>=m ||(y*arr[i-1]+x*arr[i])>=m )
                            break;
                        pb++;
                    }
                    printf("%llu\n",min(pa,pb)+1);
                }
            }
        }
    }
    return 0;
}

# include <stdio.h>

int nousefun()
{
    printf("wocaoa ;weishenmezongshiwrong");
    return 0;
}
long long fun( long long x, long long y, long long m)
{
    long long temp, ans ;
    for (temp = 0 ; y < m ; temp++)
    {
        ans= x+y, x = y, y =ans ;
    }
    return temp ;
}
int fun2()
{
    return 0;
}
long long fun3(long long x, long long y, long long m)
{
    long long tempx ;
    int i;
    for(i=0;i<100;i++)i=i;
    if (x >= 0) return fun(x, y, m) ;
    tempx = -x ;
    if (tempx <= y) return fun(x+y, y, m)+1 ;
    return fun(-1LL*(tempx%y), y, m)+ tempx/y ;
}

int main ()
{
    long long x, y, m, ans ,temp;
    while (~scanf ("%I64d%I64d%I64d", &x, &y, &m))
    {
        if (x > y)
        {
            temp=x;x=y;y=temp;
        }
        if(y>=m)printf("0\n");
        else if(y<=0)printf("-1\n");
        else
        {
            printf ("%I64d\n", fun3(x,y,m)) ;
        }
    }
    return 0 ;
}

#include <stdio.h>
#include <math.h>

void swap(long long * x, long long * y) {
    *x ^= *y; *y ^= *x; *x ^= *y;
}

long long min(long long x, long long y) {
    return x && y ? (x < y ? x : y) : (x ? x : y);
}

int fun_a(long long x, long long y, long long z) {
    int result = 0x3;
    if(x < 0 && y < 0 && z < 0) {
        if(z > x && z > y)
            return 0x0;
        x = -x; y = -y; z = -z;
    }
    if(x + y <= x)
        result ^= 0x2;
    if(x + y <= y)
        result ^= 0x1;
    if(x >= z || y >= z)
        result ^= 0x4;
    return result;
}

long long fun_b(long long a, long long b, long long c) {
    long long times = 0;
    while(a < c && b < c) {
        long long t = (long long)ceil((b - a)/(long double)b);
        a += b*(t>0?t:1); times += (t>0?t:1);
        if(a > b)
            swap(&a, &b);
    }
    return times;
//    return (long long)ceil((c-a)/(long double)b);
}

int main() {
    long long x, y, m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);

    int k = fun_a(x, y, m);

    if(k&0x4)
        printf("%d\n", 0);
    else if(k)
        printf("%I64d\n", min(k&0x1 ? fun_b(y, x, m):0, k&0x2 ? fun_b(x, y, m):0));
    else
        printf("%d\n", -1);

    return 0;
}

/*
luv_18
*/
#include<stdio.h>
int main()
{
long long int x,y,m,c=0,t;
scanf("%lld %lld %lld",&x,&y,&m);
if(m==0)
{
   if(x<0&&y<0)
   printf("-1");
   else
   printf("0");
}
else if(m>0)
{
    if(x<=0&&y<=0)
    printf("-1");
    else
    {
    if(x>y)
    {
      t=x;
      x=y;
      y=t;
    }
    if(x<0&&y<m)
    {
      x=-x;
      c=x/y;
      x=-x+(c*y);
    }
    while(x<m && y<m)
    {
      if(x<=y)
      x=x+y;
      else
      y=x+y;
      c++;
    }
    printf("%lld",c);
    }
}
else if(m<0)
{
    if(x<m&&y<m)
    printf("-1");
    else
    printf("0");
}
   // system("pause");
    return 0;
}

#include <stdio.h>

#define ll signed long long

void swap(ll *x, ll *y)
{
    ll buf = *x;
    *x = *y;
    *y = buf;
}

int main()
{
    ll x, y, m, ans = 0;
    scanf("%lld %lld %lld", &x, &y, &m);
    if(x > y) swap(&x, &y);
    if(y >= m)
    {
        printf("0");
        return 0;
    }
    if(x <= 0 && y <= 0)
    {
        printf("-1");
        return 0;
    }
    if(x <= 0)
    {
        ans = (-x) / y + 1;
        x += y * ans;
    }
    while(y < m)
    {
        ans++;
        x = x + y;
        swap(&x, &y);
    }
    printf("%lld", ans);
    return 0;
}

#include<stdio.h>
#include<math.h>
int main(){

    long long int* x;
    long long int* y;
    long long int* m;
    long long int* suma;
    long long int* mayor;
    unsigned long long int contador=0;

    x=malloc(sizeof(long long int));
    y=malloc(sizeof(long long int));
    m=malloc(sizeof(long long int));
    suma=malloc(sizeof(long long int));
    mayor=malloc(sizeof(long long int));
    //cin>>x>>y>>m;
    scanf("%I64d %I64d %I64d",x,y,m);

    /*if((*m)<0){
               (*x)=(*x)*-1;
               (*y)=(*y)*-1;
               (*m)=(*m)*-1;
    }*/

    if((*x)>=(*m)||(*y)>=(*m)){
                               printf("0");
                               //system("pause");
                               return 0;
    }

    (*suma)=(*x)+(*y);

    if((*x)<(*y)){
        if((*x)>=(*suma)){

                           printf("-1");
                           return 0;
        }
        if((*x)-(*y)<0){
                      float d=(float)(*x)/(*y);
                      //printf("linea 36 %f\n",d);
                      contador=floor(d)*-1;
                      (*x)=(*x)+(*y)*contador;
                      //printf("linea 39 %I64d\n",contador);
        }
    }

    else{
         if((*y)>=(*suma)){

                        printf("-1");
                        return 0;

         }
         if((*y)-(*x)<0){
                      float d=(float)(*y)/(*x);
                      //printf("linea 52 %f\n",d);
                      contador=floor(d)*-1;
                      (*y)=(*y)+(*x)*contador;
                      //printf("linea 55 %I64d\n",contador);
        }

    }

    free(suma);

    //printf("afuera contador:  %I64d\n",contador);
    for(;(*x)<(*m)&&(*y)<(*m);contador++){

         if((*x)>=(*y)){

                 mayor=x;
                 suma=y;

         }
         else{

              mayor=y;
              suma=x;

         }

         (*suma)=(*suma)+(*mayor);
         //printf("contador dentro del for: %I64d\n",contador);

    }
    printf("%I64d",contador);
    //system("pause");
    return 0;

}

#include <stdio.h>
#include <stdlib.h>
int main()
{
    long long int x,y,m,minimum = 0;
    scanf("%I64d%I64d%I64d",&x,&y,&m);
    while(x < m && y < m)
    {
        if(x<=0 && y<=0)
        {
            minimum = -1;
            break;
        }
        if(x < 0 && y > 0)
        {
            minimum += (long long int)(ceil(-x/y));
            x += minimum*y;
        }
        else if(x > 0 && y < 0)
        {
            minimum += (long long int)(ceil(-y/x));
            y += minimum*x;
        }
        if(x<y)x+=y;
        else y+=x;
        minimum++;
    }
    printf("%I64d",minimum);
}

#include <stdio.h>
typedef long long ll;
int main() {
    ll ch=0;
    ll x,y,m,t,d;
    scanf("%I64d %I64d %I64d",&x,&y,&m);
    if(x>=m || y>=m) { puts("0"); return 0; }
    if(x<y) t=x,x=y,y=t;
    if(x>0 && y<0) {
        d=(-y)/x;
        y+=x*d;
        ch=d;
    }
    for(;;) {
        ch++;
        if(x<y) x+=y; else y+=x;
        if(x>=m || y>=m) break;
        if(x<=0 && y<=0) break;
    }
    if(x<m && y<m) puts("-1");
    else printf("%I64d\n",ch);
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
#define max(a,b) ((a>b)?a:b)
#define min(a,b) ((a>b)?b:a)
#define LL long long
#define opfile_in(s) freopen(s,"r",stdin)
LL x,y,m;
void init();
void doit();
int main()
{
    init();
    doit();
    return 0;
}
void init()
{
    scanf("%I64d%I64d%I64d",&x,&y,&m);
}
void doit()
{
    LL tmp,ans=0;
    if(x>=m||y>=m) {printf("0\n");return;}
    if(x<=0&&y<=0) {printf("-1\n");return;}
    if(x>y){x^=y;y^=x;x^=y;}
    if(x<0){ans=(-x)/y;x+=ans*y;}
    while(x<m&&y<m)
    {
        ans++;
        tmp=x+y;
        y=max(x,y);
        x=tmp;
    }
    printf("%I64d\n",ans);
}

#include<stdio.h>
int main()
{
long long x,y,m,moves,temp;
scanf("%I64d%I64d%I64d",&x,&y,&m);
if( x<m && y<m && x<=0 && y<=0)
{
        printf("-1");
        return 0;
}
if(x>=m || y>=m)
{
printf("0");
return 0;
}
if(y<x)
{
temp=x;
x=y;
y=temp;
}
if(x<0)
{
moves = (-x)/y;
    x += y*moves;
}
while(x<m || y<m)
{
   moves++;
   if(x<y) x+=y;
   else    y+=x;
}
printf("%I64d",moves-1);
return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
	long long x, y, m, t, res = 0;
	scanf("%I64d%I64d%I64d", &x, &y, &m);
	if ( x < y )
	{
		t = x;
		x = y;
		y = t;
	}
	if ( x >= m )
		puts("0");
	else if ( x <= 0 )
		puts("-1");
	else
	{
		while ( x < m )
		{
			long long t = (x - y - 1) / x + 1;
			if ( t <= 0 )
				t = 1;
			res += t;
			t = y + t * x;
			y = x;
			x = t;
		}
		printf("%I64d\n", res);
	}
	return 0;
}

#ifdef ONLINE_JUDGE
    #define NDEBUG 1
#endif
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <limits.h>
#include <math.h>

#define long int64_t
#define fore(i,k,n) for (int _k = (k), _n = (n), i = _k; i <= _n; ++i)
#define forr(i,n,k) for (int _k = (k), _n = (n), i = _n; i >= _k; --i)
#define LIST_INIT_CAP 4
#define HASH_INIT_CAP 64
#define HASH_SKIP 11
#define TREE_INIT_CAP 1024
#define TREE_MAX_HEIGHT 64
#define DEQUE_INIT_CAP 1024
#define HEAP_INIT_CAP 1024
#define TAKEN 1
#define EMPTY 0
#define TOMB -1
#define max(a,b) (((a)>(b))?(a):(b))
#define min(a,b) (((a)<(b))?(a):(b))

#define N 100004

int main() {

    long x, y, m;
    scanf("%I64d %I64d %I64d", &x, &y, &m);
    if (m > max(x, y) && x <= 0 && y <= 0) { printf("-1"); return 0; }
    long answer = 0;
    if (x < 0 && m > y) { answer = -x / y; x += answer * y; }
    else if (y < 0 && m > x) { answer = -y / x; y += answer * x; }
    while (m > max(x, y)) {
        if (x < y) { x += y; }
        else { y += x; }
        ++answer;
    }
    printf("%I64d", answer);

    return 0;
}

#include <stdio.h>

int main()
{
    long long x, y, m, sum = 0;

    scanf("%I64d %I64d %I64d", &x, &y, &m);

    if (x >= m || y >= m) {
        puts("0");

        return 0;
    }

    if (x <= 0 && y <= 0) {
        puts("-1");

        return 0;
    }

    if (x > y) {
        long long tmp = x;
        x = y;
        y = tmp;
    }

    if (x < 0) {
        sum += -x / y;

        x += y * sum;
    }

    while (x < m && y < m) {
        if (x < y) {
            x += y;
        } else {
            y += x;
        }

        sum++;
    }

    printf("%I64d\n", sum);

    return 0;
}

#include <stdio.h>

void swap(long long *a,long long *b){
     long long tmp;
     tmp=*a;
     *a=*b;
     *b=tmp;
     }

int main(){
       long long x,y,m,round=0,ans=0,tmp,tmpround;
       scanf ("%I64d%I64d%I64d",&x,&y,&m);
       if (x>=m||y>=m) {
                       printf ("0");
                       return 0;
                       }
       if (x<=0&&y<=0&&x<m&&y<m){//check not more
          printf ("-1");
          return 0;
       }else if (x<=0&&y<=0&&(x==m||y==m)){//check not more but finish
          printf ("0");
          return 0;
       }
       if (x>y) swap(&x,&y);
       if (x==0&&y==0){
                       printf ("-1");
                       return 0;
                       }
       while (x<m&&y<m){
             if (x>y) swap(&x,&y);
             if (x<0) tmp=x*-1;
             if (x<0&&tmp/y>0){
                tmpround=tmp/y;
                x+=tmpround*y;
                ans+=tmpround;
             }else{
                   x=y+x;
                   ans++;
                   }
             }
       printf ("%I64d",ans);
       scanf (" ");
       return 0;
       }

#include <stdio.h>

long long x, y , n, m,q,s, d, c ,t ;
int main()
{
  scanf("%I64d %I64d %I64d" , &x, &y, &m) ;

  if( x >= m || y >= m)
{
    printf("0") ;
    return 0;
}
  if( x > y)
  {
      n = x ;
      q = y ;
  }
  else
  {
      n = y ;
      q = x ;
  }

  if( n <= 0)
  {
      printf("-1" ) ;
      return 0;
  }
  if( q < 0 )
  {
      c = -  q / n ;
      q = q%n ;
  }
  while( m > q && m > n)
  {
      t = n ;
      n = n + q ;
      q = t ;
      c++ ;
   //   printf("%I64d %I64d %I64d\n", c, q, n) ;
      if( n < q)
      {
           t = n ;
      n = q  ;
      q = t ;
      }

  }
   printf("%I64d", c) ;

  return 0;
  }

#include <stdio.h>

int definite(long long x, long long y){
    if(x==0||y==0){
        if(x<0||y<0)
            return -1;
        if(x>0||y>0)
            return 1;
        return 0;
    }else if(x>0&&y>0)
        return 1;
    else if(x<0&&y<0)
        return -1;
    return 20130721;
}

long long opt(long long x, long long y, long long m){
    long long tmp,step,f,f1,f2;
    if(m<0){
        x=-x;
        y=-y;
        m=-m;
    }
    if(x<y){
        tmp=x;
        x=y;
        y=tmp;
    }
    if(x>=m)
        return 0;
    step=0;
    if(y<0)
        step+=(-y)/x;
    y+=step*x;
    if(y<0){
        y+=x;
        ++step;
    }
    for(f=f2=0, f1=1; f1*x+f2*y<m; ++step){
        f=f1+f2;
        f2=f1;
        f1=f;
    }
    return step;
}

int main(void){
    int d;
    long long x,y,m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);
    d=definite(x,y);
    if((d==-1&&m>0)||(d==0&&m>0)||(d==-1&&!(x>=m||y>=m))){
        printf("-1\n");
        return 0;
    }
    if(m<=x||m<=y)
        printf("0\n");
    else
        printf("%I64d\n", opt(x, y, m));
    return 0;
}

#include<stdio.h>
int main()
{
	long long int x,y,m,ans=0;;
	scanf("%I64d%I64d%I64d",&x,&y,&m);
	while(x<m && y<m)
	{
		if(x<=0 && y<=0)
		{
			ans=-1;
			break;
		}
		if(x<0 && y>0)
		{
			ans += ((-x/y)+1);
			x += ans*y;
		}
		if(x>0 && y<0)
		{
			ans += ((-y/x)+1);
			y += ans*x;
		}
		if(x<y)	x=x+y;
		else y=x+y;
		ans++;
	}
	printf("%I64d\n",ans);
	return 0;
}

#include <stdio.h>

void swap(long long *a,long long *b){
     long long tmp;
     tmp=*a;
     *a=*b;
     *b=tmp;
     }

int main(){
       long long x,y,m,round=0,ans=0,tmp,tmpround;
       scanf ("%I64d%I64d%I64d",&x,&y,&m);
       if (x<=0&&y<=0&&x<m&&y<m){//check not more
          printf ("-1");
          return 0;
       }else if (x<=0&&y<=0&&(x==m||y==m)){//check not more but finish
          printf ("0");
          return 0;
       }
       if (x>y) swap(&x,&y);
       if (x==0&&y==0){
                       printf ("-1");
                       return 0;
                       }
       if (x>=m||y>=m) {
                       printf ("0");
                       return 0;
                       }
       while (x<m&&y<m){
             if (x>y) swap(&x,&y);
             if (x<0) tmp=x*-1;
             if (x<0&&tmp/y>0){
                tmpround=tmp/y;
                x+=tmpround*y;
                ans+=tmpround;
             }else{
                   x=y+x;
                   ans++;
                   }
             }
       printf ("%I64d",ans-1);
       scanf (" ");
       return 0;
       }

#include <stdio.h>

void swap(long long *a,long long *b){
     long long tmp;
     tmp=*a;
     *a=*b;
     *b=tmp;
     }

int main(){
       long long x,y,m,round=0,ans=0,tmp,tmpround;
       scanf ("%I64d%I64d%I64d",&x,&y,&m);
       if (x<=0&&y<=0&&x<m&&y<m){//check not more
          printf ("-1");
          return 0;
       }else if (x<=0&&y<=0&&(x==m||y==m)){//check not more but finish
          printf ("0");
          return 0;
       }
       if (x>y) swap(&x,&y);
       if (x==0&&y==0){
                       printf ("-1");
                       return 0;
                       }
       while (x<m||y<m){
             if (x>y) swap(&x,&y);
             if (x<0) tmp=x*-1;
             if (x<0&&tmp/y>0){
                tmpround=tmp/y;
                x+=tmpround*y;
                ans+=tmpround;
             }else{
                   x=y+x;
                   ans++;
                   }
             }
       printf ("%I64d",ans-1);
       scanf (" ");
       return 0;
       }

#include <stdio.h>
main(){
long long x,y,m,turn=0;
    scanf ("%I64d%I64d%I64d",&x,&y,&m);
    while ((x<m&&y<m)&&(x>0||y>0)){
            if (x>y){
                y=x+y;
                turn++;
            }else{
                x=x+y;
                turn++;
            }
    }
    if (x<=0&&y<=0) printf ("-1");
    else printf ("%d",turn);
    return 0;
}

#include <stdio.h>

int definite(long long x, long long y){
    if(x==0||y==0){
        if(x<0||y<0)
            return -1;
        if(x>0||y>0)
            return 1;
    }else if(x>0&&y>0)
        return 1;
    else if(x<0&&y<0)
        return -1;
    return 20130721;
}

long long greedy(long long x, long long y, long long m){
    int step;
    step=0;
    if(m>0){
        while(!(x>=m||y>=m)){
            if(x<y)
                x+=y;
            else
                y+=x;
            ++step;
        }
        return step;
    }else{
        while(!(x<=m||y<=m)){
            if(x>y)
                x+=y;
            else
                y+=x;
            ++step;
        }
        return step;
    }
}

int main(void){
    int d;
    long long k,x,y,m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);
    d=definite(x,y);
    if((d>0&&m<0)||(d<0&&m>0)||(d==0&&m>0)){
        printf("-1\n");
        return 0;
    }
    k=greedy(x, y, m);
    printf("%I64d\n", k);
    return 0;
}

#include <stdio.h>

int definite(long long x, long long y){
    if(x==0||y==0){
        if(x<0||y<0)
            return -1;
        if(x>0||y>0)
            return 1;
        return 0;
    }else if(x>0&&y>0)
        return 1;
    else if(x<0&&y<0)
        return -1;
    return 20130721;
}

long long greedy(long long x, long long y, long long m){
    long long step;
    /*
    if(m>0){
        while(!(x>=m||y>=m)){
            if(x<y)
                x+=y;
            else
                y+=x;
            ++step;
        }
        return step;
    }else{
        while(!(x>=m||y>=m)){
            if(x>y)
                x+=y;
            else
                y+=x;
            ++step;
        }
        return step;
    }
    */
    if(m<=x||m<=y)
        return 0;
    if(x>y){
        step=(m-y)/x;
        if((m-y)%x)
            ++step;
    }else{
        step=(m-x)/y;
        if((m-x)%y)
            ++step;
    }
    return step;
}

int main(void){
    int d;
    long long k,x,y,m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);
    d=definite(x,y);
    if((d>0&&m<0)||(d<0&&m>0)||(d==0&&m>0)||(d<0&&!(x>=m||y>=m))){
        printf("-1\n");
        return 0;
    }
    k=greedy(x, y, m);
    printf("%I64d\n", k);
    return 0;
}

#include <stdio.h>

int definite(long long x, long long y){
    if(x==0||y==0){
        if(x<0||y<0)
            return -1;
        if(x>0||y>0)
            return 1;
        return 0;
    }else if(x>0&&y>0)
        return 1;
    else if(x<0&&y<0)
        return -1;
    return 20130721;
}

long long opt(long long x, long long y, long long m){
    long long tmp,step,f,f1,f2;
    if(m<0){
        x=-x;
        y=-y;
        m=-m;
    }
    if(x<y){
        tmp=x;
        x=y;
        y=tmp;
    }
    if(x>=m)
        return 0;
    step=0;
    if(y<0)
        step+=(-y)/x;
    y+=step*x;
    if(y<0){
        y+=x;
        ++step;
    }
    for(f=f2=0, f1=1; f1*x+f2*y<m; ++step){
        f=f1+f2;
        f2=f1;
        f1=f;
    }
    return step;
}

int main(void){
    int d;
    long long k,x,y,m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);
    d=definite(x,y);
    if((d==1&&m<0)||(d==-1&&m>0)||(d==0&&m>0)||(d==-1&&!(x>=m||y>=m))){
        printf("-1\n");
        return 0;
    }
    k=opt(x, y, m);
    printf("%I64d\n", k);
    return 0;
}

#include<stdio.h>
int main()
{long long int x,y,m,i=0;
    scanf("%I64d%I64d%I64d",&x,&y,&m);
    while(1)
    {if(x>=m||y>=m)
    {
    printf("%d",i);break;}

    else if(x>y)
    y=x+y;
    else
    x=x+y;
    i++;
    if(x+y<=x||x+y<=y)
    {
    printf("-1");break;}
}
return 0;
}

#include<stdio.h>
int main()
{long long int x,y,m,i=0;
    scanf("%I64d%I64d%I64d",&x,&y,&m);
    while(1)
    {if(x>=m||y>=m)
    {
    printf("%I64d",i);break;}

    else if(x>y)
    y=x+y;
    else
    x=x+y;
    i++;
    if(x+y<=x||x+y<=y)
    {
    printf("-1");break;}
}
return 0;
}

#include<stdio.h>
int main()
{long long int x,y,m,i=0,j=0;
    scanf("%I64d%I64d%I64d",&x,&y,&m);
    while(1)
    {if(x+y<=x&&x+y<=y)
    {
    printf("-1");break;}
	if(x>=m||y>=m)
    {
    printf("%I64ld",i+j);break;}

    if(x>y)
    y=x+y;
    else
    x=x+y;
    if(i<1000000000000000000)
    i++;
    else
    j++;
}
return 0;
}

#include <stdio.h>

int main() {
    long long x, y, m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);
    if (x >= m || y >= m || (x <= 0 && y <= 0)) {
        printf("-1");
        return 0;
    }
    long long s = 0;
    while (x < m && y < m) {
        if (x < y)
            x += y;
        else
            y += x;
        s++;
    }
    printf("%I64d", s);
    return 0;
}

#include <stdio.h>

int main() {
    long long x, y, m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);
    if (x >= m || y >= m) {
        printf("-1");
        return 0;
    }
    long long s = 0;
    while (x < m && y < m) {
        if (x < y)
            x += y;
        else
            y += y;
        s++;
    }
    printf("%I64d", s - 1);
    return 0;
}

#include <stdio.h>

int main() {
    long long x, y, m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);
    if (x >= m || y >= m || x < 0 || y < 0) {
        printf("-1");
        return 0;
    }
    long long s = 0;
    while (x < m && y < m) {
        if (x < y)
            x += y;
        else
            y += x;
        s++;
    }
    printf("%I64d", s);
    return 0;
}

#include <stdio.h>
#include <math.h>

int main() {
    long long x, y, m, mi = -1;
    scanf("%I64d%I64d%I64d", &x, &y, &m);
    if (y != 0) {
        long long a = m - x, t = a / y;
        if (t * y == a && y / abs(y) * a / abs(a) == 1)
            mi = t;
    }
    if (x != 0) {
        long long a = m - y, t = a / x;
        if (t * x == a && x / abs(x) * a / abs(a) == 1)
            if (mi == -1 || t < mi)
                mi = t;
    }
    printf("%I64d", mi);
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int v=1;
long int x,y,m;
scanf("%d%d%d",&x,&y,&m);
long int count=0;
while(v==1)
{
if(x<=0&&y<=0)
{
    if(m>x&&m>y)
{
printf("-1");
v=2;
break;
}
else {
    printf("0");
    v=2;
    break;
}

}

 else
 {
     if(x>=m||y>=m)
{
printf("%ld",count);
v=2;
break;
}
else
{
count++;
if(x<y)
x+=y;
else
y+=x;
}
}
}
return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main()
{
long long int x,y,m,g=0,s=0,sum=0;
scanf("%I64d%I64d%I64d",&x,&y,&m);
long long  int count=0;
if(x>y)
{
g=x;
s=y;
}
else
{
g=y;
s=x;
}
if(x<=0&&y<=0)
{if(m<=x||m<=y)
printf("0");
else
printf("-1");
exit(0);
}
else
{

if(s<0)
{
count=(-s)/g +1;
s=s+count*g;
}

while(g<m)
{sum=g+s;
s=g;
g=sum;
count++;
}
}
printf("%I64d",count);
return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main()
{
long long int x,y,m,g=0,s=0,sum=0;
scanf("%I64d%I64d%I64d",&x,&y,&m);
long int count=0;
if(x>y)
{
g=x;
s=y;
}
else
{
g=y;
s=x;
}
if(x<=0&&y<=0)
{if(m<=x||m<=y)
printf("0");
else
printf("-1");
exit(0);
}
else
{

if(s<0)
{
count=(-s)/g +1;
s=s+count*g;
}

while(g<m)
{sum=g+s;
s=g;
g=sum;
count++;
}
}
printf("%ld",count);
return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main()
{
long long int x,y,m,g=0,s=0,sum=0;
scanf("%I64d%I64d%I64d",&x,&y,&m);
long int count=0;
if(x>y)
{
g=x;
s=y;
}
else
{
g=y;
s=x;
}
if(x<=0&&y<=0)
{if(m<x||m<y)
printf("0");
else
printf("-1");
exit(0);
}
else
{
while(g<m)
{
while(s<0)
{s+=g;
count++;}

sum=g+s;
s=g;
g=sum;
count++;
}
}
printf("%ld",count);
return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main()
{
long long int x,y,m,g=0,s=0,sum=0;
scanf("%I64d%I64d%I64d",&x,&y,&m);
long int count=0;
if(x>y)
{
g=x;
s=y;
}
else
{
g=y;
s=x;
}
if(x<=0&&y<=0)
{if(m<=x||m<=y)
printf("0");
else
printf("-1");
exit(0);
}
else
{

if(s<0)
{
count=(-x)/y +1;
s=s+count*y;
}

while(g<m)
{sum=g+s;
s=g;
g=sum;
count++;
}
}
printf("%ld",count);
return 0;
}

#include <stdio.h>
#include <conio.h>
#include <math.h>

typedef long long ll;
int main()
{
    ll x, y, m, i, tmp;
    scanf("%I64d %I64d %I64d", &x, &y, &m);
    if (x > y){ tmp = x; x = y; y = tmp; }
    i = ceil((m + x)*1.0 / (x + y));
    if (i >= 1) printf("%I64d", i);
    else printf("-1");
    return 0;
}

#include <stdio.h>
#include <conio.h>
#include <math.h>

typedef long long ll;
int main()
{
    ll x, y, m, i, tmp;
    scanf("%I64d %I64d %I64d", &x, &y, &m);
    if (x > y){ tmp = x; x = y; y = tmp; }
    if (y >= m) i = 0;
    else
    {
        if (x >=0 && y > 0 || x>0 && y>=0)
            i = ceil((m + x)*1.0 / (x + y));
        else if (x<=0 && y>0 && abs(x*1.0) <= y)
            i = ceil((m - y + 2 * x)*1.0 / (x + y))+1;
        else i = -1;

    }
    printf("%I64d", i);
    return 0;
}

#include <stdio.h>
#include <conio.h>
#include <math.h>

typedef long long ll;
int main()
{
    ll x, y, m, i, tmp;
    scanf("%I64d %I64d %I64d", &x, &y, &m);
    if (x > y){ tmp = x; x = y; y = tmp; }
    if (y >= m) i = 0;
    else
    {
        if (x > 0 && y > 0)
            i = ceil((m + x)*1.0 / (x + y));
        else if (x<0 && y>0 && abs(x*1.0) < y)
            i = ceil((m - y + 2 * x)*1.0 / (x + y))+1;
        else i = -1;

    }
    printf("%I64d", i);
    return 0;
}

#include<stdio.h>
#include<inttypes.h>

int main()
{
        int64_t x,y,m,ans = 0,factor,x_prime;
        scanf("%I64d",&x);
        scanf("%I64d",&y);
        scanf("%I64d",&m);
        if (x <= 0 && y <= 0 && m<= 0)
        {
            if (x >= m || y >= m)
            {
                printf("0\n");
            }
            else
                printf("-1\n");
        }
        else if (x <= 0 && y <= 0 && m > 0)
        {
            printf("-1\n");
        }
        else if (x >= 0 && y >= 0 && m < 0)
        {
            printf("0\n");
        }
        else if (x >= 0 && y <= 0 && m <= 0)
        {
            printf("0\n");
        }
        else if (x <= 0 && y >=0 && m <= 0)
        {
            printf("0\n");
        }
        else if (x >= 0 && y > 0 && m >= 0)
        {
            if (x >= m || y >= m)
            {
                printf("0");
            }
            else
            {
                while (x < m && y < m)
                {
                        if(x <= y)
                        {
                                x = x + y;
                                ans++;
                        }
                        else
                        {
                                y = x + y;
                                ans++;
                        }
                }
                printf("%I64d\n",ans);
            }
        }
        else if (x < 0 && y > 0 && m >= 0)
        {
            x_prime = -x;
            factor = x_prime/y;
            x += factor * y;
            ans += factor;
            if (x >= m || y >= m)
            {
                printf("%I64d",ans);
            }
            else
            {
                while (x < m && y < m)
                {
                        if(x <= y)
                        {
                                x = x + y;
                                ans++;
                        }
                        else
                        {
                                y = x + y;
                                ans++;
                        }
                }
                printf("%I64d\n",ans);
            }
        }
        else if (x > 0 && y < 0 && m >= 0)
        {
            x_prime = -y;
            factor = x_prime/x;
            y += factor * x;
            ans += factor;
            if (x >= m || y >= m)
            {
                printf("%I64d",ans);
            }
            else
            {
                while (x < m && y < m)
                {
                        if(x <= y)
                        {
                                x = x + y;
                                ans++;
                        }
                        else
                        {
                                y = x + y;
                                ans++;
                        }
                }
                printf("%I64d\n",ans);
            }
        }
    return 0;
}

#include <stdio.h>

int main()
{
    long long x, y, m;
    long long ans = 0;
    long long tmp;
    scanf("%I64d%I64d%I64d", &x, &y, &m);
    if ( x > y )
    {
        tmp = x;
        x = y;
        y = tmp;
    }
    if ( x <= 0 && y <= 0 && y < m )
    {
        printf("-1\n");
        return 0;
    }
    if ( x < 0 && y > 0 )
    {
        if ( m < 0 )
        {
            ans += -m/y;
            x += -m/y*y;
        }
        else
        {
            ans += -x/y;
            x += -x/y*y;
        }
    }
    while ( y < m )
    {
        ans++;
        tmp = x+y;
        if ( tmp > y )
        {
            x = y;
            y = tmp;
        }
        else
        {
            x = tmp;
        }
    }
    printf("%I64d\n", ans);
    return 0;
}

#include<stdio.h>

int main()
{   int x,y,m;
    scanf("%d%d%d",&x,&y,&m);
    int count=0;
  int temp;
    while(x<m && x>=-1)
    {     if(x>y){
     temp = y;
     y = x;
     x = temp;
    }
        x = x+y;
        count++;
        if(x==m)
        {
            printf("%d",count);
            return 0;
        }
    }
    printf("-1");
    return 0;
}

#include<stdio.h>

int main()
{   int x,y,m;
    scanf("%d%d%d",&x,&y,&m);
    int count=0;
    while(x<m && x>=-1)
    {
        x = x+y;
        count++;
        if(x==m)
        {
            printf("%d",count);
            return 0;
        }
    }
    printf("-1");
    return 0;
}

/*
Author:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%   LALIT KUNDU      %%%%%%%%
%%%%%%%%   IIIT HYDERABAD   %%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<malloc.h>
#define llu long long int
#define min(a,b)(a>b?b:a)
#define max(a,b)(a<b?b:a)
#define sort(arr,n) qsort(arr,n,sizeof(arr[0]),compare)
#define sd(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define su(n) scanf("%llu",&n)
#define rep(i,start,end) for(i=start; i<end; i++)
#define pdn(n) printf("%d\n",n)
#define pln(n) printf("%lld\n",n)
#define pun(n) printf("%llu\n",n)
#define pd(n) printf("%d",n)
#define pl(n) printf("%lld",n)
#define pu(n) printf("%llu",n)
#define pn printf("\n")
#define ps printf(" ")
int main()
{
    llu i,arr[10000];
    arr[0]=0;
    arr[1]=1;
    arr[2]=1;
    for(i=3; ; i++)
    {
        arr[i]=arr[i-1]+arr[i-2];
        if(arr[i]>1000000000000000000)
            break;
    }
    llu x,y,m;
    scanf("%lld%lld%lld",&x,&y,&m);
    if(x<=0 && y<=0)
    {
        if(x<m && y<m)
            printf("-1");
        else
            printf("0");
    }
    else
    {
        if(x>=m || y>=m)
        {
            printf("0\n");
            return 0;
        }
        if(y<x)
        {
            llu temp;
            x=temp;
            x=y;
            y=temp;
        }
        llu p=0;
        if(x<0)
        {
            p=(llu)ceil(-1.0*x/y);
            x=x+p*y;
        }
        if(x>=m || y>=m)
        {
            printf("%lld\n",p);
            return 0;
        }
        llu la=x+y,lb=y,pa=p+1;
        if(la>=m || lb>=m)
        {
            printf("%lld\n",pa);
            return 0;
        }
        for(i=2; ; i++)
        {
            if((x*arr[i]+y*arr[i+1])>=m ||(x*arr[i-1]+y*arr[i])>=m )
                break;
            pa++;
        }
        la=x+y,lb=x;
        llu pb=p+1;
        if(la>=m || lb>=m)
        {
            printf("%lld\n",pb);
            return 0;
        }
        for(i=2; ; i++)
        {
            if((y*arr[i]+x*arr[i+1])>=m ||(y*arr[i-1]+x*arr[i])>=m )
                break;
            pb++;
        }
        printf("%llu\n",min(pa,pb)+1);
    }
    return 0;
}

#include <stdio.h>
#include <math.h>

int fun_a(long long x, long long y) {
    int result = 0x3;
    if(x <= 0)
        result ^= 0x1;
    if(y <= 0)
        result ^= 0x2;
    return result;
}

long long fun_b(long long a, long long b, long long c) {
    return (long long)ceil((c-a)/(long double)b);
}

long long min(long long x, long long y) {
    return x && y ? (x < y ? x : y) : (x ? x : y);
}

int main() {
    long long x, y, m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);

    int k = fun_a(x, y);
    if(k)
        printf("%I64d\n", min(k&0x1 ? fun_b(y, x, m):0, k&0x2 ? fun_b(x, y, m):0));
    else
        printf("%d\n", -1);

    return 0;
}

#include <stdio.h>
#include <math.h>

void swap(long long * x, long long * y) {
    *x ^= *y; *y ^= *x; *x ^= *y;
}

long long min(long long x, long long y) {
    return x && y ? (x < y ? x : y) : (x ? x : y);
}

int fun_a(long long x, long long y) {
    int result = 0x3;
    if(x <= 0)
        result ^= 0x1;
    if(y <= 0)
        result ^= 0x2;
    return result;
}

long long fun_b(long long a, long long b, long long c) {
    long long times = 0;
    while(a < c && b < c) {
        a += b; times++;
        if(a > b)
            swap(&a, &b);
    }
    return times;
//    return (long long)ceil((c-a)/(long double)b);
}

int main() {
    long long x, y, m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);

    int k = fun_a(x, y);
    if(k)
        printf("%I64d\n", min(k&0x1 ? fun_b(y, x, m):0, k&0x2 ? fun_b(x, y, m):0));
    else
        printf("%d\n", -1);

    return 0;
}

#include <stdio.h>
#include <math.h>

void swap(long long * x, long long * y) {
    *x ^= *y; *y ^= *x; *x ^= *y;
}

long long min(long long x, long long y) {
    return x && y ? (x < y ? x : y) : (x ? x : y);
}

int fun_a(long long x, long long y, long long z) {
    int result = 0x3;
    if(x < 0 && y < 0 && z < 0) {
        if(z > x && z > y)
            return 0x0;
        x = -x; y = -y; z = -z;
    }
    if(x + y <= x)
        result ^= 0x2;
    if(x + y <= y)
        result ^= 0x1;
    if(x >= z || y >= z)
        result ^= 0x4;
    return result;
}

long long fun_b(long long a, long long b, long long c) {
    long long times = 0;
    while(a < c && b < c) {
        long long t = ceil((b - a)/(long double)b);
        a += b*(t?t:1); times += (t?t:1);
        if(a > b)
            swap(&a, &b);
    }
    return times;
//    return (long long)ceil((c-a)/(long double)b);
}

int main() {
    long long x, y, m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);

    int k = fun_a(x, y, m);

    if(k&0x4)
        printf("%d\n", 0);
    else if(k)
        printf("%I64d\n", min(k&0x1 ? fun_b(y, x, m):0, k&0x2 ? fun_b(x, y, m):0));
    else
        printf("%d\n", -1);

    return 0;
}

#include <stdio.h>
#include <math.h>

void swap(long long * x, long long * y) {
    *x ^= *y; *y ^= *x; *x ^= *y;
}

long long min(long long x, long long y) {
    return x && y ? (x < y ? x : y) : (x ? x : y);
}

int fun_a(long long x, long long y) {
    int result = 0x3;
    if(x <= 0)
        result ^= 0x1;
    if(y <= 0)
        result ^= 0x2;
    return result;
}

long long fun_b(long long a, long long b, long long c) {
    long long times = 0;
    while(a < c && b < c) {
        a += b; times++;
        if(a > b)
            swap(&a, &b);
    }
    return times;
//    return (long long)ceil((c-a)/(long double)b);
}

int main() {
    long long x, y, m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);

    if(m < 0)
        {x = -x; y = -y; m = -m;}

    int k = fun_a(x, y);
    if(k)
        printf("%I64d\n", min(k&0x1 ? fun_b(y, x, m):0, k&0x2 ? fun_b(x, y, m):0));
    else
        printf("%d\n", -1);

    return 0;
}

#include <stdio.h>
#include <math.h>

void swap(long long * x, long long * y) {
    *x ^= *y; *y ^= *x; *x ^= *y;
}

long long min(long long x, long long y) {
    return x && y ? (x < y ? x : y) : (x ? x : y);
}

int fun_a(long long x, long long y, long long z) {
    int result = 0x3;
    if(z < 0)
        {x = -x; y = -y; z = -z;}
    if(x + y <= x)
        result ^= 0x2;
    if(x + y <= y)
        result ^= 0x1;
    if(z < x && z < y)
        result = 0x0;
    return result;
}

long long fun_b(long long a, long long b, long long c) {
    long long times = 0;
    while(a < c && b < c) {
        a += b; times++;
        if(a > b)
            swap(&a, &b);
    }
    return times;
//    return (long long)ceil((c-a)/(long double)b);
}

int main() {
    long long x, y, m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);

    int k = fun_a(x, y, m);

    if(k)
        printf("%I64d\n", min(k&0x1 ? fun_b(y, x, m):0, k&0x2 ? fun_b(x, y, m):0));
    else
        printf("%d\n", -1);

    return 0;
}

#include <stdio.h>
#include <math.h>

void swap(long long * x, long long * y) {
    *x ^= *y; *y ^= *x; *x ^= *y;
}

long long min(long long x, long long y) {
    return x && y ? (x < y ? x : y) : (x ? x : y);
}

int fun_a(long long x, long long y, long long z) {
    int result = 0x3;
    if(z < 0)
        {x = -x; y = -y; z = -z;}
    if(x + y <= x)
        result ^= 0x2;
    if(x + y <= y)
        result ^= 0x1;
    if(z < x && z < y)
        result = 0x0;
    else if(x >= z || y >= z)
        result ^= 0x4;
    return result;
}

long long fun_b(long long a, long long b, long long c) {
    long long times = 0;
    while(a < c && b < c) {
        long long t = ceil((b - a)/(long double)b);
        a += b*(t?t:1); times += (t?t:1);
        if(a > b)
            swap(&a, &b);
    }
    return times;
//    return (long long)ceil((c-a)/(long double)b);
}

int main() {
    long long x, y, m;
    scanf("%I64d%I64d%I64d", &x, &y, &m);

    int k = fun_a(x, y, m);

    if(k&0x4)
        printf("%d\n", 0);
    else if(k)
        printf("%I64d\n", min(k&0x1 ? fun_b(y, x, m):0, k&0x2 ? fun_b(x, y, m):0));
    else
        printf("%d\n", -1);

    return 0;
}

/*
luv_18
*/
#include<stdio.h>
int main()
{
long long int x,y,m,c=0,t;
scanf("%lld %lld %lld",&x,&y,&m);
if(m==0)
{
   if(x<0&&y<0)
   printf("-1");
   else
   printf("0");
}
else if(m>0)
{
    if(x<=0&&y<=0)
    printf("-1");
    else
    {
    if(x>y)
    {
      t=x;
      x=y;
      y=t;
    }
    if(x<0)
    {
      x=-x;
      c=x/y;
      x=x-(c*y);
    }
    while(x<m && y<m)
    {
      if(x<=y)
      x=x+y;
      else
      y=x+y;
      c++;
    }
    printf("%lld",c);
    }
}
else if(m<0)
{
    if(x<m&&y<m)
    printf("-1");
    else
    printf("0");
}
   // system("pause");
    return 0;
}

/*
luv_18
*/
#include<stdio.h>
int main()
{
long long int x,y,m,c=0,t;
scanf("%lld %lld %lld",&x,&y,&m);
if(m==0)
{
   if(x<0&&y<0)
   printf("-1");
   else
   printf("0");
}
else if(m>0)
{
    if(x<=0&&y<=0)
    printf("-1");
    else
    {
    if(x>y)
    {
      t=x;
      x=y;
      y=t;
    }
    if(x<0)
    {
      x=-x;
      c=x/y;
      x=-x+(c*y);
    }
    while(x<m && y<m)
    {
      if(x<=y)
      x=x+y;
      else
      y=x+y;
      c++;
    }
    printf("%lld",c);
    }
}
else if(m<0)
{
    if(x<m&&y<m)
    printf("-1");
    else
    printf("0");
}
   // system("pause");
    return 0;
}

#include<stdio.h>
#include<math.h>
int main(){

    long long int* x;
    long long int* y;
    long long int* m;
    long long int* suma;
    long long int* mayor;
    unsigned long long int contador=0;

    x=malloc(sizeof(long long int));
    y=malloc(sizeof(long long int));
    m=malloc(sizeof(long long int));
    suma=malloc(sizeof(long long int));
    mayor=malloc(sizeof(long long int));
    //cin>>x>>y>>m;
    scanf("%I64d %I64d %I64d",x,y,m);

    /*if((*m)<0){
               (*x)=(*x)*-1;
               (*y)=(*y)*-1;
               (*m)=(*m)*-1;
    }*/

    if((*x)==(*m)||(*y)==(*m)){
                               printf("0");
                               return 0;
    }

    (*suma)=(*x)+(*y);

    if((*x)<(*y)){
        if((*x)>=(*suma)){

                           printf("-1");
                           return 0;
        }
        if((*x)-(*y)<0){
                      float d=(float)(*x)/(*y);
                      //printf("linea 36 %f\n",d);
                      contador=floor(d)*-1;
                      (*x)=(*x)+(*y)*contador;
                      //printf("linea 39 %I64d\n",contador);
        }
    }

    else{
         if((*y)>=(*suma)){

                        printf("-1");
                        return 0;

         }
         if((*y)-(*x)<0){
                      float d=(float)(*y)/(*x);
                      //printf("linea 52 %f\n",d);
                      contador=floor(d)*-1;
                      (*y)=(*y)+(*x)*contador;
                      //printf("linea 55 %I64d\n",contador);
        }

    }

    free(suma);

    //printf("afuera contador:  %I64d\n",contador);
    for(;(*x)<(*m)&&(*y)<(*m);contador++){

         if((*x)>=(*y)){

                 mayor=x;
                 suma=y;

         }
         else{

              mayor=y;
              suma=x;

         }

         (*suma)=(*suma)+(*mayor);
         //printf("contador dentro del for: %I64d\n",contador);

    }
    printf("%I64d",contador);
    return 0;

}

#include<stdio.h>
#include<math.h>
int main(){

    long long int* x;
    long long int* y;
    long long int* m;
    long long int* suma;
    long long int* mayor;
    unsigned long long int contador=0;

    x=malloc(sizeof(long long int));
    y=malloc(sizeof(long long int));
    m=malloc(sizeof(long long int));
    suma=malloc(sizeof(long long int));
    mayor=malloc(sizeof(long long int));
    //cin>>x>>y>>m;
    scanf("%I64d %I64d %I64d",x,y,m);

    /*if((*m)<0){
               (*x)=(*x)*-1;
               (*y)=(*y)*-1;
               (*m)=(*m)*-1;
    }*/

    (*suma)=(*x)+(*y);

    if((*x)<(*y)){
        if((*x)>=(*suma)){

                           printf("-1");
                           return 0;
        }
        if((*x)-(*y)<0){
                      float d=(float)(*x)/(*y);
                      //printf("linea 36 %f\n",d);
                      contador=floor(d)*-1;
                      (*x)=(*x)+(*y)*contador;
                      //printf("linea 39 %I64d\n",contador);
        }
    }

    else{
         if((*y)>=(*suma)){

                        printf("-1");
                        return 0;

         }
         if((*y)-(*x)<0){
                      float d=(float)(*y)/(*x);
                      //printf("linea 52 %f\n",d);
                      contador=floor(d)*-1;
                      (*y)=(*y)+(*x)*contador;
                      //printf("linea 55 %I64d\n",contador);
        }

    }

    free(suma);

    //printf("afuera contador:  %I64d\n",contador);
    for(;(*x)<(*m)&&(*y)<(*m);contador++){

         if((*x)>=(*y)){

                 mayor=x;
                 suma=y;

         }
         else{

              mayor=y;
              suma=x;

         }

         (*suma)=(*suma)+(*mayor);
         //printf("contador dentro del for: %I64d\n",contador);

    }
    printf("%I64d",contador);
    free(x);
    free(y);
    free(m);
    free(suma);
    free(mayor);
    return 0;

}

#include<stdio.h>
#include<math.h>
int main(){

    long long int* x;
    long long int* y;
    long long int* m;
    long long int* suma;
    long long int* mayor;
    unsigned long long int contador=0;

    x=malloc(sizeof(long long int));
    y=malloc(sizeof(long long int));
    m=malloc(sizeof(long long int));
    suma=malloc(sizeof(long long int));
    mayor=malloc(sizeof(long long int));
    //cin>>x>>y>>m;
    scanf("%I64d %I64d %I64d",x,y,m);

    if((*m)<0){
               (*x)=(*x)*-1;
               (*y)=(*y)*-1;
               (*m)=(*m)*-1;
    }

    (*suma)=(*x)+(*y);

    if((*x)<(*y)){
        if((*x)>=(*suma)){

                           printf("-1");
                           return 0;
        }
        if((*x)-(*y)<0){
                      float d=(float)(*x)/(*y);
                      //printf("linea 36 %f\n",d);
                      contador=floor(d)*-1;
                      (*x)=(*x)+(*y)*contador;
                      //printf("linea 39 %I64d\n",contador);
        }
    }

    else{
         if((*y)>=(*suma)){

                        printf("-1");
                        return 0;

         }
         if((*y)-(*x)<0){
                      float d=(float)(*y)/(*x);
                      //printf("linea 52 %f\n",d);
                      contador=floor(d)*-1;
                      (*y)=(*y)+(*x)*contador;
                      //printf("linea 55 %I64d\n",contador);
        }

    }

    free(suma);

    //printf("afuera contador:  %I64d\n",contador);
    for(;(*x)<(*m)&&(*y)<(*m);contador++){

         if((*x)>=(*y)){

                 mayor=x;
                 suma=y;

         }
         else{

              mayor=y;
              suma=x;

         }

         (*suma)=(*suma)+(*mayor);
         //printf("contador dentro del for: %I64d\n",contador);

    }
    printf("%I64d",contador);
    free(x);
    free(y);
    free(m);
    free(suma);
    free(mayor);
    return 0;

}

#include <stdio.h>
#include <stdlib.h>
int main()
{
    long long int x,y,m,minimum = 0;
    scanf("%I64d%I64d%I64d",&x,&y,&m);
    while(x < m && y < m)
    {
        if(x<=0 && y<=0)
        {
            minimum = -1;
            break;
        }
        if(x < 0 && y > 0)
        {
            minimum += (int)(ceil(-x/y));
            x += minimum*y;
        }
        else if(x > 0 && y < 0)
        {
            minimum += (int)(ceil(-y/x));
            y += minimum*x;
        }
        if(x<y)x+=y;
        else y+=x;
        minimum++;
    }
    printf("%I64d",minimum);
}

#include <stdio.h>
#include <stdlib.h>
int main()
{
    long long int x,y,m,minimum = 0;
    scanf("%I64d%I64d%64d",&x,&y,&m);
    while(x < m && y < m)
    {
        if(x<=0 && y<=0)
        {
            minimum = -1;
            break;
        }
        if(x < 0 && y > 0)
        {
            minimum += (int)(ceil(-x/y));
            x += minimum*y;
        }
        else if(x > 0 && y < 0)
        {
            minimum += (int)(ceil(-y/x));
            y += minimum*x;
        }
        if(x<y)x+=y;
        else y+=x;
        minimum++;
    }
    printf("%I64d",minimum);
}

#include <stdio.h>
typedef long long ll;
int main() {
    int i;
    ll x,y,m,u,v;
    scanf("%I64d %I64d %I64d",&x,&y,&m);
    if(x>=m || y>=m) { puts("0"); return 0; }
    for(i=1;i<100000000;i++) {
        u=x; v=y;
        if(u<v) u+=v;
        else v+=u;
        if(u<0 && v<0 && u<m && v<m) { puts("-1"); return 0; }
        x=u; y=v;
        if(x>=m || y>=m) break;
    }
    if(x<m && y<m) puts("-1");
    else printf("%d\n",i);
    return 0;
}

#include <stdio.h>
typedef long long ll;
int main() {
    int i;
    ll x,y,m,u,v;
    scanf("%I64d %I64d %I64d",&x,&y,&m);
    if(x>=m || y>=m) { puts("0"); return 0; }
    for(i=0;i<100000000;i++) {
        u=x; v=y;
        if(u<v) u+=v;
        else v+=u;
        if(u<0 && v<0 && u<m && v<m) { puts("-1"); return 0; }
        x=u; y=v;
        if(x>=m || y>=m) break;
    }
    if(x<m || y<m) puts("-1");
    else printf("%d\n",i);
    return 0;
}

#include <stdio.h>
typedef long long ll;
int main() {
    ll ch=0;
    ll x,y,m,t,d;
    scanf("%I64d %I64d %I64d",&x,&y,&m);
    if(x>=m || y>=m) { puts("0"); return 0; }
    if(x<y) t=x,x=y,y=t;
    if(x>0 && y<0) {
        d=(-y)/x;
        y+=x*d;
        ch=d;
    }
    for(;;ch++) {
        if(x<y) x+=y; else y+=x;
        if(x>=m || y>=m) break;
        if(x<=0 && y<=0) break;
    }
    if(x<m && y<m) puts("-1");
    else printf("%I64d\n",ch);
    return 0;
}

#include <stdio.h>
typedef long long ll;
int main() {
    int i;
    ll x,y,m,u,v;
    scanf("%I64d %I64d %I64d",&x,&y,&m);
    if(x>=m && y>=m) { puts("0"); return 0; }
    for(i=0;i<10000000;i++) {
        u=x; v=y;
        if(u<v) u+=v;
        else v+=u;
        if(u<0 && v<0 && u<m && v<m) { puts("-1"); return 0; }
        x=u; y=v;
        if(x>=m && y>=m) break;
    }
    if(x<m || y<m) puts("-1");
    else printf("%d\n",i);
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
#define max(a,b) ((a>b)?a:b)
#define min(a,b) ((a>b)?b:a)
#define LL long long
#define opfile_in(s) freopen(s,"r",stdin)
LL x,y,m;
void init();
void doit();
int main()
{
    init();
    doit();
    return 0;
}
void init()
{
    scanf("%I64d%I64d%I64d",&x,&y,&m);
}
void doit()
{
    LL tmp,ans=0;
    if(x<=0&&y<=0)
    {
         printf("%d\n",(x>m||y>m)?0:-1);return;
    }
    while(x<m&&y<m)
    {
        ans++;
        tmp=x+y;
        y=max(x,y);
        x=tmp;
    }
    printf("%I64d\n",ans);
}

#include<stdio.h>
int main()
{
long long x,y,m,moves=0;
scanf("%I64d%I64d%I64d",&x,&y,&m);

if((x+y < 0) && !(x>=m || y>=m)) moves=-1;
if(!(x>=m || y>=m) && moves != -1)
{
   if(x<y) x+=y;
   else    y+=x;
   moves++;
}
printf("%I64d",moves);
return 0;
}

#include <stdio.h>

int main()
{
    long long x, y, m, sum = 0;

    scanf("%I64d %I64d %I64d", &x, &y, &m);

    if (x >= m || y >= m) {
        puts("0");

        return 0;
    }

    if (x <= 0 && y <= 0) {
        puts("-1");

        return 0;
    }

    if (x > y) {
        long long tmp = x;
        x = y;
        y = tmp;
    }

    if (x < 0) {
        sum += -x / y;

        x += y * sum;
    }

    while (y < m) {
        long long z = x + y;

        x = y;
        y = z;
        sum++;
    }

    printf("%I64d\n", sum);

    return 0;
}

#include <stdio.h>

long long x, y , n, m,q,s, d ;
int main()
{
  scanf("%I64d %I64d %I64d" , &x, &y, &m) ;

  if( x > y)
  {
      n = x ;
      q = y ;
  }
  else
  {
      n = y ;
      q = x ;
  }

  if( n <= 0)
  {
      printf("-1" ) ;
      return 0;
  }

  d = m - q ;

  if( d <= 0)
  {
      printf("0") ;

  }
  else{
        s = d/ n ;
     if( d%n == 0)
     {
         printf("%I64d", s) ;
     }
  else
  {
       printf("%I64d", s+1) ;
  }
  }

  return 0;
  }

#include <stdio.h>

long long x, y , n, m,q,s, d, c ,t ;
int main()
{
  scanf("%I64d %I64d %I64d" , &x, &y, &m) ;

  if( x > y)
  {
      n = x ;
      q = y ;
  }
  else
  {
      n = y ;
      q = x ;
  }

  if( n <= 0)
  {
      printf("-1" ) ;
      return 0;
  }

//  d = m - q ;

 /* if( d <= 0)
  {
      printf("0") ;

  }
  else{
        s = d/ n ;
     if( d%n == 0)
     {
         printf("%I64d", s) ;
     }
  else
  {
       printf("%I64d", s+1) ;
  }
  }*/

  while( m > q && m > n)
  {
      t = n ;
      n = n + q ;
      q = n ;
      c++ ;
  }
   printf("%I64d", c) ;

  return 0;
  }

#include <stdio.h>

long long x, y , n, m,q,s, d, c ,t ;
int main()
{
  scanf("%I64d %I64d %I64d" , &x, &y, &m) ;

  if( x > y)
  {
      n = x ;
      q = y ;
  }
  else
  {
      n = y ;
      q = x ;
  }

  if( n <= 0)
  {
      printf("-1" ) ;
      return 0;
  }

//  d = m - q ;

 /* if( d <= 0)
  {
      printf("0") ;

  }
  else{
        s = d/ n ;
     if( d%n == 0)
     {
         printf("%I64d", s) ;
     }
  else
  {
       printf("%I64d", s+1) ;
  }
  }*/

  while( m > q && m > n)
  {
      t = n ;
      n = n + q ;
      q = t ;
      c++ ;
     // printf("%I64d %I64d %I64d\n", c, q, n) ;

  }
   printf("%I64d", c) ;

  return 0;
  }

#include <stdio.h>

long long x, y , n, m,q,s, d, c ,t ;
int main()
{
  scanf("%I64d %I64d %I64d" , &x, &y, &m) ;

  if( x >= m || y >= m)
{
    printf("0") ;
    return 0;
}
  if( x > y)
  {
      n = x ;
      q = y ;
  }
  else
  {
      n = y ;
      q = x ;
  }

  if( n <= 0)
  {
      printf("-1" ) ;
      return 0;
  }

//  d = m - q ;

 /* if( d <= 0)
  {
      printf("0") ;

  }
  else{
        s = d/ n ;
     if( d%n == 0)
     {
         printf("%I64d", s) ;
     }
  else
  {
       printf("%I64d", s+1) ;
  }
  }*/

  while( m > q && m > n)
  {
      t = n ;
      n = n + q ;
      q = t ;
      c++ ;
     // printf("%I64d %I64d %I64d\n", c, q, n) ;

  }
   printf("%I64d", c) ;

  return 0;
  }

#include <stdio.h>

void swap(long long *a,long long *b){
     long long tmp;
     tmp=*a;
     *a=*b;
     *b=tmp;
     }

int main(){
       long long x,y,m,round=0,ans=0,tmp,tmpround;
       scanf ("%I64d%I64d%I64d",&x,&y,&m);
       if (x<=0&&y<=0&&x<m&&y<m){//check not more
          printf ("-1");
          return 0;
       }else if (x<=0&&y<=0&&(x==m||y==m)){//check not more but finish
          printf ("0");
          return 0;
       }
       if (x>y) swap(&x,&y);
       if (x==0&&y==0){
                       printf ("-1");
                       return 0;
                       }
       /*if (x>=m||y>=m) {
                       printf ("0");
                       return 0;
                       }*/
       while (x<m&&y<m){
             if (x>y) swap(&x,&y);
             if (x<0) tmp=x*-1;
             if (x<0&&tmp/y>0){
                tmpround=tmp/y;
                x+=tmpround*y;
                ans+=tmpround;
             }else{
                   x=y+x;
                   ans++;
                   }
             }
       printf ("%I64d",ans);
       scanf (" ");
       return 0;
       }

#include <stdio.h>

void swap(long long *a,long long *b){
     long long tmp;
     tmp=*a;
     *a=*b;
     *b=tmp;
     }

int main(){
       long long x,y,m,round=0,ans=0;
       scanf ("%I64d%I64d%I64d",&x,&y,&m);
       if (x<=0&&y<=0&&x<m&&y<m){//check not more
          printf ("-1");
          return 0;
       }else if (x<=0&&y<=0&&(x==m||y==m)){//check not more but finish
          printf ("0");
          return 0;
       }
       if (x>y) swap(&x,&y);
       if (x==0&&y==0){
                       printf ("-1");
                       return 0;
                       }
       while (x<m||y<m){
             if (x>y) swap(&x,&y);
             x=y+x;
             ans++;
             }
       printf ("%I64d",ans);
       return 0;
       }

#include<stdio.h>
#include<string.h>
int main()
{
	long long int x,y,m,cnt=0;
	scanf("%lld",&x);
	scanf("%lld",&y);
	scanf("%lld",&m);

	if(x>=m || y>=m)
	{
		printf("%d\n",0);
		return 0;
	}
	if(x<=0 && y<=0)
	{
		printf("%d\n",-1);
		return 0;
	}
	if(x>y)
	{
		long long int tmp = x;
		x=y;
		y=tmp;
	}
	if(x<0)
	{
		cnt += -x/y;
		x+=y * cnt;
	}
	while(x<m && y<m)
	{
		if(x<y)
			x+=y;
		else
			y+=x;
	}
	printf("%lld\n",cnt);
	return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
	long long int x,y,m,cnt=0;
	scanf("%lld",&x);
	scanf("%lld",&y);
	scanf("%lld",&m);
	if(x>=m || y>=m)
	{
		printf("%d\n",0);
		return 0;
	}
	if(x<=0 && y<=0)
	{
		printf("%d\n",-1);
		return 0;
	}
	if(x>y)
	{
		long long int tmp = x;
		x=y;
		y=tmp;
	}
	if(x<0)
	{
		cnt += -x/y;
		x+=y * cnt;
	}
	while(x<m && y<m)
	{
		if(x<y)
			x+=y;
		else
			y+=x;
	}
	printf("%lld\n",cnt);
	return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
	long int x,y,m;
	scanf("%ld",&x);
	scanf("%ld",&y);
	scanf("%ld",&m);
	int count=0;

	if((x==0 && y<=0) || (y==0 && x<=0) || (x<=0 && y<=0)|| (x==0 && y==0))
	{
		printf("%d\n",-1);

	}
	else
	{
		if(x>y)
		{
			while(y<m)
			{
				y+=x;
				count++;
			}
		}
		else
		{
			while(x<m)
			{
				x+=y;
				count++;
			}
		}

	printf("%d\n",count);
}return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
	long long int x,y,m;
	scanf("%lld",&x);
	scanf("%lld",&y);
	scanf("%lld",&m);
	int count=0;

	if((x==0 && y<=0) || (y==0 && x<=0) || (x<=0 && y<=0)|| (x==0 && y==0))
	{
		printf("%d\n",-1);

	}
	else if (x>=m || y>=m)
	{
		printf("%d\n",0 );
	}
	else{

		while(y<m && x<m)
		{
			if(x>y)
			{
				y+=x;
			}
			else
			{
				x+=y;
			}
			count++;
		}
	printf("%d\n",count);
	}return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
	long long int x,y,m;
	scanf("%lld",&x);
	scanf("%lld",&y);
	scanf("%lld",&m);
	int count=0;

	if(x>0 || y>0)
	{
		if(x>=m || y>=m)
			printf("%d\n",0 );

		else
		{
			while(y<m && x<m)
			{
				if(x>y)
				{
					y+=x;
				}
				else
				{
					x+=y;
				}
				count++;
			}printf("%d\n",count );
		}
	}
	else{
	printf("%d\n",-1);
	}return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
	long long int x,y,m;
	scanf("%lld",&x);
	scanf("%lld",&y);
	scanf("%lld",&m);
	int count=0;

	if((x==0 && y<=0) || (y==0 && x<=0) || (x<=0 && y<=0)|| (x==0 && y==0))
	{
		printf("%d\n",-1);

	}
	else
	{
		if(x>y)
		{
			while(y<m)
			{
				y+=x;
				count++;
			}
		}
		else
		{
			while(x<m)
			{
				x+=y;
				count++;
			}
		}

	printf("%d\n",count);
}return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
	long long int x,y,m;
	scanf("%lld",&x);
	scanf("%lld",&y);
	scanf("%lld",&m);
	int count=0;

	if((x==0 && y<=0) || (y==0 && x<=0) || (x<=0 && y<=0)|| (x==0 && y==0))
	{
		printf("%d\n",-1);

	}
	else
	{
		while(y<m && x<m)
		{
			if(x>y)
			{
				y+=x;
			}
			else
			{
				x+=y;
			}count++;
		}
	printf("%d\n",count);
}return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

int main(int argc, const char *argv[])
{
  long long x, y, m;
  assert(scanf("%lld %lld %lld", &x, &y, &m) == 3);

  if (x <= 0 && y <= 0) {
    if (x < m && y < m) {
      printf("-1\n");
      return 0;
    }
    else {
      printf("0\n");
      return 0;
    }
  }

  long long s, t, m2;
  long long count = 0;

  if (m > 0) { m2 = 0; }
  else { m2 = m; }

  if (x <= 0) {
    t = (m2 - x) / y;
    count += t;
    x += y*t;
  }

  if (y <= 0) {
    t = (m2 - y) / x;
    count += t;
    y += x*t;
  }

  printf("%lld, %lld, %lld\n", x, y, m);

  while (x < m && y < m) {
    s = x + y;
    if (x < y) { x = s; }
    else { y = s; }
    count++;
  }

  printf("%lld\n", count);
  return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

int main(int argc, const char *argv[])
{
  long long x, y, m;
  assert(scanf("%lld %lld %lld", &x, &y, &m) == 3);

  if (x <= 0 && y <= 0) {
    if (x < m && y < m) {
      printf("-1\n");
      return 0;
    }
    else {
      printf("0\n");
      return 0;
    }
  }

  long long s, t, m2;
  long long count = 0;

  if (m > 0) { m2 = 0; }
  else { m2 = m; }

  if (x <= 0) {
    t = (m2 - x) / y;
    count += t;
    x += y*t;
  }

  if (y <= 0) {
    t = (m2 - y) / x;
    count += t;
    y += x*t;
  }

  while (x < m && y < m) {
    s = x + y;
    if (x < y) { x = s; }
    else { y = s; }
    count++;
  }

  printf("%lld\n", count);
  return 0;
}

#include<stdio.h>
int main()
{
	long long int a,b,x,p,q,c,y,temp;
	scanf("%I64d %I64d %I64d",&a,&b,&x);
	if(a>b)
	{
		temp=b;
		b=a;
		a=temp;
	}
	if(b>=x)
	printf("0");
	else
	{
		if(a+b<=0)
		printf("-1");
		else
		{
			c=0;
			if(a<0)
			{
				a=a+b;
				c++;
				if(a>b)
				{
					temp=b;
					b=a;
					a=temp;
				}
			}
			while(b<x)
			{
				c++;
				p=b;
				q=a+b;
				a=p;
				b=q;
				//printf("%I64d %I64d\n",b,c);
			}
			printf("%I64d",c);
		}
	}
	return 0;
}

#include<stdio.h>
int main()
{
	long long int a,b,x,p,q,c,y,temp;
	scanf("%I64d %I64d %I64d",&a,&b,&x);
	if(a>b)
	{
		temp=b;
		b=a;
		a=temp;
	}
	if(b>=x)
	printf("0");
	else
	{
		if(a<=0 && b<=0)
		printf("-1");
		else
		{
			c=0;
			if(a<0)
			{
				a=a+b;
				c++;
				if(a>b)
				{
					temp=b;
					b=a;
					a=temp;
				}
			}
			while(b<x)
			{
				c++;
				p=b;
				q=a+b;
				a=p;
				b=q;
				//printf("%I64d %I64d\n",b,c);
			}
			printf("%I64d",c);
		}
	}
	return 0;
}

#include <stdio.h>

typedef long long LL_t;

int main()
{
	LL_t x,y,m,temp,Cnt;
	scanf("%I64d %I64d %I64d",&x,&y,&m);
	if(x<y)
	{
		temp=x;
		x=y;
		y=temp;
	}
	if(x<m&&x<=0)
	{
		printf("-1\n");
		return 0;
	}
	if(x>=m)
	{
		printf("0\n");
		return 0;
	}
	if(y<0)
	{
		y=-y;
		if(y%x!=0)
		{
			Cnt=y/x+1;
			y=y%x;
			if(x<y)
			{
				temp=x;
				x=y;
				y=temp;
			}
			if(x>=m)
			{
				printf("%I64d\n",Cnt);
				return 0;
			}
		}
		else
		{
			Cnt=y/x;
			y=0;
		}
	}
	else
	{
		Cnt=1;
	}
	while(1)
	{
		temp=x+y;
		if(temp>=m)
		{
			printf("%I64d\n",Cnt);
			return 0;
		}
		y=temp;
		if(x<y)
		{
			temp=x;
			x=y;
			y=temp;
		}
		++Cnt;
	}
	return 0;
}

#include <stdio.h>

typedef long long LL_t;

int main()
{
	LL_t x,y,m,temp,Cnt;
	scanf("%I64d %I64d %I64d",&x,&y,&m);
	if(x<y)
	{
		temp=x;
		x=y;
		y=temp;
	}
	if(x<m&&x<=0)
	{
		printf("-1\n");
		return 0;
	}
	if(x>=m)
	{
		printf("0\n");
		return 0;
	}
	if(y<0)
	{
		y=-y;
		if(y%x!=0)
		{
			Cnt=y/x+1;
			y=y%x;
			if(x<y)
			{
				temp=x;
				x=y;
				y=temp;
			}
		}
		else
		{
			Cnt=y/x;
			y=0;
		}
	}
	else
	{
		Cnt=1;
	}
	while(1)
	{
		temp=x+y;
		if(temp>=m)
		{
			printf("%I64d\n",Cnt);
			return 0;
		}
		y=temp;
		if(x<y)
		{
			temp=x;
			x=y;
			y=temp;
		}
		++Cnt;
	}
	return 0;
}

#include <stdio.h>

typedef long long LL_t;

int main()
{
	LL_t x,y,m,temp,Cnt;
	scanf("%I64d %I64d %I64d",&x,&y,&m);
	if(x<y)
	{
		temp=x;
		x=y;
		y=temp;
	}
	if(x>=m)
	{
		printf("0\n");
		return 0;
	}
	if(x<=0)
	{
		printf("-1\n");
		return 0;
	}
	if(y<0)
	{
		y=-y;
		if(y%x!=0)
		{
			Cnt=y/x+1;
			y=(LL_t)y%x;
		}
		else
		{
			Cnt=y/x;
			y=0;
		}
	}
	else
	{
		Cnt=0;
	}
	while(1)
	{
		++Cnt;
		temp=x+y;
		y=temp;
		if(temp>=m)
		{
			printf("%I64d\n",Cnt);
			return 0;
		}
		temp=x;
		x=y;
		y=temp;
	}
	return 0;
}

#include <stdio.h>

int main()
{
	long long int a, b, m;
	int count;
	scanf("%lld", &a);
	scanf("%lld", &b);
	scanf("%lld", &m);

	if (a>=m || b>=m)
	{
		count = 0;
		printf("%d\n", count);
		return 0;
	}

	if((a<0 && b<0) || (a==0 && b<=0) || (b==0 && a<=0))
	{
		count = -1;
		printf("%d\n", count);
		return 0;
	}
	count = 0;
	while(a<m && b<m)
	{
		if (a<0)
		{
			count = a/b+1;
			a = b*count + a;
		}
		if (b<0)
		{
			count = b/a+1;
			b = a*count + b;
		}

		if(a>=b)
		{
			b = a+b;
			count++;
		}
		else
		{
			a = a+b;
			count++;
		}
	}
	printf("%d\n", count);
	return 0;
}

#include<stdio.h>

long long int perfect(long long int n,long long int m,long long int b);
int main()
{
    long long int N,M,a,R;
    scanf("%I64d%I64d%I64d",&N,&M,&a);
    if((N<=0&&M<=0&&a>0)||(N>=0&&M>=0&&a<0))
        printf("-1\n");
    else
         {R=perfect(N,M,a);
         printf("%I64d\n",R);
         }
         return 0;

}
long long int d=0;
long long int perfect(long long int n,long long int m,long long int b)
{
    long long int temp;
   if(n<m){n=n+m;++d;}
   else{m=m+n;++d;}
   temp=d;
   if(n>=b||m>=b){d=0;return temp;}
   else
   return perfect(n,m,b);

}

#include<stdio.h>
#define max(a,b) ((a)>(b)?(a):(b))
int main(void)
{
    long long x,y,k,f1,f2,count;
    scanf("%I64d%I64d%I64d",&x,&y,&k);
    f2=max(x,y);
    f1=x+y-f2;
    if(f1<k&&f2<k&&f1+f2<=f1)
        printf("0\n");
    else
    {

        for(count=0;;)
        {
            if(f2>=k||f1>=k)
            {
                printf("%I64d\n",count);
                break;
            }
            f1=f1+f2;
            count++;
            if(f2>=k||f1>=k)
            {
                printf("%I64d\n",count);
                break;
            }
            f2=f1+f2;
            count++;
        }
    }
    return 0;
}

#include<stdio.h>
#define max(a,b) ((a)>(b)?(a):(b))
int main(void)
{
    long long x,y,k,f1,f2,count;
    scanf("%I64d%I64d%I64d",&x,&y,&k);
    f2=max(x,y);
    f1=x+y-f2;
    if(f1<0&&f2==0)
    {
        if(k>0)
            printf("-1\n");
        else if(k<=0)
            printf("0\n");
    }
    else
    {

        for(count=0;;)
        {
            if(f2>=k||f1>=k)
            {
                printf("%I64d\n",count);
                break;
            }
            f1=f1+f2;
            count++;
            if(f2>=k||f1>=k)
            {
                printf("%I64d\n",count);
                break;
            }
            f2=f1+f2;
            count++;
        }
    }
    return 0;
}

#include<stdio.h>
#define max(a,b) ((a)>(b)?(a):(b))
int main(void)
{
    long long i,j,k,sum=0,m,n;
    scanf("%I64d%I64d%I64d",&i,&j,&k);
    m=max(i,j);
    n=i+j-m;
    if(m>=k||n>=k)
        printf("0\n");
    else if(m<=0)
        printf("-1\n");
    else {
        if(n<0)
        {
            sum=(-n)/m+(-n)%m;
            n+=sum*m;
        }
        while(m<k)
        {
            if(n)
            {
                m=m+n;
                n=m-n;
            }
            else {
                n=m;
            }
            sum++;
        }
        printf("%I64d\n",sum);
    }
    return 0;
}

#include<stdio.h>
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
int main(void)
{
    long long x,y,k,f1,f2,count;
    scanf("%I64d%I64d%I64d",&x,&y,&k);
    f2=max(x,y);
    f1=x+y-f2;
    if(f1<k&&f2<k&&f2<=0)
        printf("-1\n");
    else
    {

        for(count=0;;)
        {
            if(f2>=k)
            {
                printf("%I64d\n",count);
                break;
            }
            f1=max(f1+f2,f1);
            count++;
            if(f1>=k)
            {
                printf("%I64d\n",count);
                break;
            }
            f2=max(f1+f2,f2);
            count++;
        }
    }
    return 0;
}

#include<stdio.h>
#define max(a,b) ((a)>(b)?(a):(b))
int main(void)
{
    long long x,y,k,f1,f2,count;
    scanf("%I64d%I64d%I64d",&x,&y,&k);
    f2=max(x,y);
    f1=x+y-f2;
    if(f1<k&&f2<k&&f1+f2<=f1)
        printf("-1\n");
    else
    {

        for(count=0;;)
        {
            if(f2>=k||f1>=k)
            {
                printf("%I64d\n",count);
                break;
            }
            f1=f1+f2;
            count++;
            if(f2>=k||f1>=k)
            {
                printf("%I64d\n",count);
                break;
            }
            f2=f1+f2;
            count++;
        }
    }
    return 0;
}

#include<stdio.h>
main()
{
long long x,b,y,m,cnt=0,i,j;
 scanf("%I64d",&x);
 scanf("%I64d",&y);
 scanf("%I64d",&m);
 if(x<=0&&y<=0&&m>x&&m>y)
 {
     printf("-1");
     exit(0);
 }
 if(x<y)
 {
     b=y/x;
     cnt=b;
     x=b*x;
 }
 else
 {
     b=x/y;
     cnt=b;
     y=b*y;
 }
     while(x<m && y<m)
     {
         if(x>y)
         y=y+x;
         else
         x=x+y;
         cnt++;
     }

     printf("%I64d",cnt);
     return 0;
     }

#include <stdio.h>
#include <stdlib.h>

int main(void) {
    long long x, y, m, cnt = 0;
    scanf ("%I64d %I64d %I64d", &x, &y, &m);
    if (x + y <= x && x + y <= y) {
        printf("%d", -1);
        exit(0);
    }
    while (x < m && y < m) {
        cnt++;
        if (x > y)
            y = x + y;
        else
            x = x + y;
    }
    printf("%I64d", cnt);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main(void) {
    long long x, y, m, cnt = 0;
    scanf ("%I64d %I64d %I64d", &x, &y, &m);
    if (x + y < 0) {
        printf("%d", -1);
        exit(0);
    }
    while (x < m && y < m) {
        cnt++;
        if (x > y)
            y = x + y;
        else
            x = x + y;
    }
    printf("%I64d", cnt);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main(void) {
    long long x, y, m, cnt = 0;
    scanf ("%I64d %I64d %I64d", &x, &y, &m);
    if (x + y < 0) {
        printf("%d", -1);
        exit(0);
    }
   while (x <= m && y <= m) {
        cnt++;
        if (x > y)
            y = x + y;
        else
            x = x + y;
    }
    printf("%I64d", cnt);
    return 0;
}

# include <stdio.h>

long long fun( long long int  x, long long int y, long long int m)
{
    long long int s,temp;
    for (s = 0 ; y < m ; s++)
        temp = x+y, x = y, y = temp ;
    return s ;
}

int main ()
{
    long long x, y, m,xx,temp ;
    while (~scanf ("%I64d%I64d%I64d", &x, &y, &m))
    {
        if (x > y)
        {
            temp=y;
            y=x;
            x=temp;
        }
        if(y>=m)printf("0\n");
        else if(y<=0)printf("-1\n");
        else
        {
            if(x>=0)
                printf("%I64d\n",fun(x,y,m));
            else
            {
                xx=-x;
                if(xx<=y)printf("%I64d\n",fun(x+y,y,m)+1);
                else
                    printf("I64d\n",fun(-1LL*(xx%y),y,m)+xx/y);
            }
        }
    }
    return 0 ;
}

#include <stdio.h>

long long fun( long long int  x, long long int y, long long int m)
{
    long long int s,temp;
    for (s = 0 ; y < m ; s++)
    {
        temp = x+y, x = y, y = temp ;
    }
    return s ;
}

int main ()
{
    long long x, y, m,xx,temp ;
    while (~scanf ("%I64d%I64d%I64d", &x, &y, &m))
    {
        if (x > y)
        {
            temp=y;
            y=x;
            x=temp;
        }
        if(y>=m)printf("0\n");
        else if(y<=0)printf("-1\n");
        else
        {
            if(x>=0)
                printf("%I64d\n",fun(x,y,m));
            else
            {
                xx=-x;
                if(xx<=y)printf("%I64d\n",fun(x+y,y,m)+1);
                else
                {
                    printf("I64d\n",fun(-1LL*(xx%y),y,m)+xx/y);
                }
            }
        }
    }
    return 0 ;
}

#include<stdio.h>
int main()
{
    long long int n,m,x,i,k;
    scanf("%lld %lld %lld",&n,&m,&x);
    if(x>n&&x>m&&n<=0&&m<=0)
    {
        printf("-1\n");
    }
    else
    {
        for(i=0;;i++)
        {
            if(n>=x||m>=x)
            {
                break;
            }
            else if(n>0&&m<0)
            {
                k=(((-m)/n)+1)*n;
                m=m+k;
                i=i+((-m)/n);
            }
            else if(n<m)
            {
                n=n+m;
            }
            else
            {
                m=m+n;
            }
        }
        printf("%lld\n",i);
    }
    return 0;
}

/* practice with Dukkha */
#include <stdio.h>

int main() {
	long long x, y, z, m, ans;

	scanf("%lld%lld%lld", &x, &y, &m);
	if (m <= 0) {
		printf(x >= m || y >= m ? "0\n" : "-1\n");
		return 0;
	}
	if (x <= 0 && y <= 0) {
		printf("-1\n");
		return 0;
	}
	if (x > y)
		z = x, x = y, y = z;
	ans = 0;
	if (x < 0) {
		ans += (-x + y - 1) / y;
		x = (x % y + y) % y;
	}
	while (y < m) {
		z = x + y, x = y, y = z;
		ans++;
	}
	printf("%lld\n", ans);
	return 0;
}