# Leo Salazar
# Python 2
# 12/14/24
# More Lists of Lists and Freqency List

'''
# Using ord
print(ord('b')-ord('a'))

# ord and freq list
freq = [0]*26
freq[ord('e')-ord('a')] = 1
print(freq)
'''

'''
# Counting Letters

# open/read file
f = open('input.txt', 'r')
stuff = f.read()

# freq list 
freq = [0]*26

# make every letter lowercase
stuff = stuff.lower()

# looping through each character
for l in stuff:

    # check if character is in alphabet
    if l.isalpha():

        # increment letter counter
        freq[ord(l) - ord('a')] += 1

print(freq)
'''

'''
# showing isnumeric() method
a = 'abc123'
for l in a:
    print(l.isnumeric())
'''

# open/read file
f = open('input.txt', 'r')
stuff = f.read()

# split input by line
stuff = stuff.split('\n')

# store parameters in variables
params = stuff[0].split()
students = int(params[0])
grades = int(params[1])

# freq list
freq = [0]*5

# looping through the students
for i in range(1, students + 1):
    cur = stuff[i].split()

    # looping through their grades
    for j in range(0, grades):
        g = int(cur[j])

        # counting letter grades
        if g >= 90:
            freq[0] += 1
        elif g >= 80:
            freq[1] += 1
        elif g >= 70:
            freq[2] += 1
        elif g >= 60:
            freq[3] += 1
        else:
            freq[4] += 1

print(freq)
