def namenumber(name):
    """Calculate the 'name number' of a name (by wikihow.com).

    Arguments:
    name - full name containing only lower and uppercase letters and
           spaces

    Return value: int being the name number"""
    num0 = 0
    num = 0
    alphabet = "abcdefghijklmnopqrstuvwxyz"

    for char in name.lower().replace(" ", ""):
        num0 += (alphabet.find(char) + 1) % 9 + 1
    
    if num0 in {11, 22 , 33}: return num0

    for digit in str(num0):
        num += int(digit)

    return num