from collections import Counter
N = int(input())
R = input()
cnt = Counter(R)
ansMax = 0
ansMin = float('inf')
for i in range(1, 5):
    ansMax = max(ansMax, cnt[str(i)])
    ansMin = min(ansMin, cnt[str(i)])
print(ansMax, ansMin)

0c83c1d1d1cefe944ec6fb876e6edf554dded2f4
<mask token>

<mask token>
for i in range(1, 5):
    ansMax = max(ansMax, cnt[str(i)])
    ansMin = min(ansMin, cnt[str(i)])
print(ansMax, ansMin)

<mask token>
N = int(input())
R = input()
cnt = Counter(R)
ansMax = 0
ansMin = float('inf')
for i in range(1, 5):
    ansMax = max(ansMax, cnt[str(i)])
    ansMin = min(ansMin, cnt[str(i)])
print(ansMax, ansMin)

from collections import Counter
N = int(input())
R = input()
cnt = Counter(R)
ansMax = 0
ansMin = float('inf')
for i in range(1, 5):
    ansMax = max(ansMax, cnt[str(i)])
    ansMin = min(ansMin, cnt[str(i)])
print(ansMax, ansMin)
