while True:
    try:
        s = input()
        dic = {
           'letter' : 0,
            'space' : 0,
            'num' : 0,
            'other' : 0
        }
        for c in s:
            if c.isalpha():
                dic['letter'] += 1
            elif c == ' ':
                dic['space'] += 1
            elif c.isdigit():
                dic['num'] += 1
            else:
                dic['other'] += 1
        for k in ['letter', 'space', 'num', 'other']:
            print(dic[k])
    except:
        break