program main
  integer(16)::n,i,j,k,ans,price,ma,x,a,b
  !integer,allocatable::
  !character(*)::s
read(*,*)a,b,x
!write(*,*)x

ans=(x-b)/a
ma=a*10**9+b*floor(log10(dble(10**9))+1)
if(ans.gt.ma) then
write(*,*) 10**9
  stop
end if
!ans=(x-b)/a
!ans=0
!ma=10
do while(.true.)
  ans=ans+1
  price=ans*a+b*floor(log10(dble(ans))+1)
  if(x.le.price) exit
  if(ans==10**9+1) exit
end do
write(*,*) ans-1
end program
