import inspect


def get_fn_parameters(fn):
    """ return the number of input parameters of the fn , None on error"""
    param_len = len(inspect.getfullargspec(fn).args)
    if inspect.ismethod(fn):
        param_len -= 1
    return param_len