def potatoes(p0, w0, p1):
    """
    - p1/100 = water1 / water1 + (1 - p0/100) * w0
      => water1 = w0 * p1/100 * (1 - p0/100) / (1 - p1/100)
    - dry = w0 * (1 - p0/100)
    - w1 = water1 + dry = w0 * (100 - p0) / (100 - p1)

    Example:
    98/100 = water1 / water1 + (1- 99/100) * 100
    water1 = 49
    w1 = 49 + 1 = 50
    """
    w1 = w0 * (100 - p0) / (100 - p1)
    return int(w1)