Not to be confused with [chessboard](https://en.wikipedia.org/wiki/Chessboard).
The first line of input contains a single integer *N* (1 ≤ *N* ≤ 100) — the number of cheeses you have.

The next *N* lines describe the cheeses you have. Each line contains two space-separated strings: the name of the cheese and its type. The name is a string of lowercase English letters between 1 and 10 characters long. The type is either "soft" or "hard. All cheese names are distinct.
none
9
brie soft
camembert soft
feta soft
goat soft
muenster soft
asiago hard
cheddar hard
gouda hard
swiss hard
3
6
parmesan hard
emmental hard
edam hard
colby hard
gruyere hard
asiago hard
4
9
gorgonzola soft
cambozola soft
mascarpone soft
ricotta soft
mozzarella soft
bryndza soft
jarlsberg soft
havarti soft
stilton soft
5
1
provolone hard
1
4
emmental hard
feta soft
goat soft
roquefort hard
2
1
camembert soft
1
2
muenster soft
asiago hard
2
32
auhwslzn soft
kpq hard
eukw soft
sinenrsz soft
ajuoe soft
gapj soft
uyuhqv hard
ifldxi hard
pgy soft
jnjhh hard
byswtu soft
hdr hard
jamqcp hard
mrknxch soft
ghktedrf hard
utley hard
reinr hard
vbhk hard
euft soft
xspriqy soft
trooa soft
uylbj soft
kgt soft
lhc hard
rwxhlux soft
suoku soft
dhhoae soft
lisv soft
wlco hard
bhmptm soft
ualppum soft
lpxizrhr soft
7
18
bcvyeeap soft
ubb hard
srbb hard
emcmg hard
melqan hard
uenps soft
cpyminr hard
dpx soft
glkj hard
msozshuy soft
xnvrcozn soft
tftctb soft
cija hard
gxl hard
pjoja soft
dhzze hard
iyvl soft
ctrszg hard
5
31
pevkjopz soft
smqei hard
xhfmuqua soft
gtmbnvn hard
kdvztv soft
cziuxm hard
gdswd hard
nawkigiz soft
eehdplwt hard
izhivjj soft
tvnkqkc hard
wefwgi hard
uxczrz hard
jdqudhgp soft
hmyzqb soft
wwlc soft
dsax soft
slefe soft
ahfitc hard
lztbmai soft
zcatg soft
hwlubzmy soft
jkbl soft
bfdfh soft
zshdiuce hard
eobyco soft
ckg hard
ahcwzw soft
vtaujlke soft
iwfdcik hard
itb soft
7
27
dbilglfh hard
iecrbay hard
cpunhmf hard
szvvz soft
qsbg hard
vdzexx hard
aiuvj soft
fuccez hard
dvscmzd hard
gps soft
dev hard
nwlfdh soft
nrlglw soft
ypff hard
wig hard
jvgtfo hard
zyp soft
cpgbws soft
xjsyjgi hard
izizf hard
izrwozx hard
wau hard
gzq hard
ffqa hard
najmkxn soft
vqtw hard
mymaoi hard
7
17
qojmshqd soft
cwbg hard
xomz soft
ymxfk soft
usledpbg hard
haaw hard
imwjce soft
aioff soft
sumpqbzx soft
zffbvrq hard
qosengs soft
kbori soft
kxsnrkc soft
wzsxh hard
isibmmg soft
hrfnj soft
hdaavekw soft
5
18
zpvpfze soft
sdlnere soft
kwkvgz soft
zla soft
dxlx hard
kpmnsooq soft
lomen soft
vywn soft
wfrc hard
miash soft
krbjwpyw hard
gpeksveq soft
jhbfqs soft
kfncick hard
nwkqbsv soft
lywaxy soft
hbxh soft
bba hard
5
21
azjrptg hard
ynvyfw hard
cpoe hard
jqbglg hard
sqh hard
ynya hard
aldaolkg soft
drf hard
esdsm hard
fjyua hard
vzlnckg hard
yxjfqjd hard
vkyay hard
ebhhke hard
msibo hard
vvmkenyh hard
xzk hard
lggl hard
vrb hard
iep hard
rsseijey hard
7
42
quxukow soft
wcn soft
pbwg soft
lrp hard
phdvfz soft
idkvymji soft
obq soft
yhx soft
ijygw soft
ztzz soft
uwdhnwu soft
dgnuuej hard
hntyyzr soft
qxf hard
ztg soft
hnpq soft
uhznu soft
itelgl hard
ggceadhw hard
rxq soft
kznmshem hard
lri hard
dalh soft
gyzzuht hard
zvx soft
bjffln soft
wnjwrvi hard
xudeknru hard
mql soft
inoddzbf hard
pdg soft
gtfk soft
hyv soft
xkv soft
wajqepw soft
dgc soft
sefwhuoa soft
bliirvj soft
hqea soft
ped soft
yjgwc soft
atlyha soft
8
17
gewvfeq soft
oaximz hard
xkfscel soft
nbxdbggw soft
gxgsscq hard
mqbu hard
btpzl soft
psv soft
iov soft
hliudz soft
bmiu soft
qqegoe hard
ufq soft
mgx soft
awjthx hard
onjmhee soft
xoarup soft
5
from math import sqrt, ceil
n = int(input())
cnt = 0
for i in range(0, n):
    a, b = input().split()
    if b == 'soft':
        cnt += 1
cnt = max(cnt, n-cnt)
ans = (int(ceil(sqrt(2*cnt))))
if(ceil((ans-1)*(ans-1)/2)) >= cnt:
    ans -= 1
print(ans)
