
class BuyAnIntegerAnswer
  @@ans = nil

  def self.buy_an_integer(a, b, x)
    0.upto(18) do |n|
      d = n.to_s.length

      if (a + b) > x
        @@ans = 0
        break
      end

      if (x >= a * (10 ** 9) + b * 10)
        @@ans = 10 ** 9
        break
      end

      # TODO: bsearch
      if x > (a * n + b * d)
        @@ans = n
      elsif @@ans
        break
      end
    end

    return @@ans
  end
end

data = STDIN.read.strip
puts BuyAnIntegerAnswer.buy_an_integer(data)
