import math


def number_of_payments(p: float, i: float, a: float) -> float:
    """
    Calculates the number of payments given loan principal, interest rate and annuity payment
    :param p: loan principal value
    :param i: monthly nominal interest rate
    :param a: annuity payment
    :return: number of payments
    """
    numerator = a
    denominator = a - (i*p)
    return math.log(numerator/denominator, i+1)