n=int(input())
x=input().split(' ')
br=0
lvs=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
lbr=['0','1','2','3','4','5','6','7','8','9']
liz=['.','?','!']
for i in range(len(x)):
for j in range(1):
if x[i][0] in lvs and '0' not in x[i] and '1' not in x[i] and '2' not in x[i] and '3' not in x[i] and '4' not in x[i] and '5' not in x[i] and '6' not in x[i] and '7' not in x[i] and '8' not in x[i] and '9' not in x[i] and '.' not in x[i] and '!' not in x[i] and '?' not in x[i]:
br=br+1
print(br)