def perm(N, R):
    """
    The permutation function P(N,R) = N!/(N-R)!

    :param N
        Total elements.
    
    :param R
        Number to choose.
    
    :return
        <int:permutations>
    """
    result = 1
    while N > R:
        result *= N
        N -= 1
    return result