def num_states(spin_str_element):

    """
    This function evaluates de spin number string, formatted as s=a/b and
    returns the number of states 2*s + 1.

    In the table we have three type of strings:
    1. spin numbers integers formatted with 1 or 2 characters, e.g s=1, and s=10.
    2. spin numbers formatted with 3 characters. e.g. s=3/2.
    3. spin numbers formatted with 4 characters. e.g. s=11/2

    Parameters
    ----------
    :var spin_str_element: This string class element contains the information
                      in [88:102], about spin, parity, and
                      isospin charge.

    Returns:
    --------
    :var states: this integer variable contains the number of states associated
            to the `spin_str_element` string

    """

    if len(spin_str_element) == 1 or len(spin_str_element) == 2:
        states = 2*int(spin_str_element) + 1
        return states

    elif len(spin_str_element) == 3:
        num = int(spin_str_element[0])
        den = int(spin_str_element[2])
        states = 2*num//den + 1
        return states

    elif len(spin_str_element) == 4:
        num = int(spin_str_element[0:2])
        den = int(spin_str_element[3])
        states = 2*num//den + 1
        return states

    else:
        return None