input = """Bimoash
Grayjunthur
Chubikee
Bimothur
Shakeeprak
Shaphamchu
Shahexrom
Mobilo
Phamashgray
Mobisha
Mopatthur
Junashprak
Hexkeebi
Mophamash
Keepatchu
Junbilo
Mochuprak
Romshapham
Patjunthur
Grayphamrom
Phampatchu
Thurhexpham
Rompatchu
Romashsha
Patshaash
Phamjunhex
Keethurrom
Shamoprak
Grayjunprak
Prakhexrom
Thurmochu
Shajunlo
Bilopat
Lojunbi
Biromchu
Lothurgray
Junkeethur
Patmokee
Patbiash
Bikeegray
Junashchu
Prakashjun
Ashthurgray
Ashthurpat
Romjunlo
Lomojun
Keepraksha
Thurkeerom
Prakashmo
Thurshagray
Grayjunkee
Mothurprak
Patsharom
Keeromthur
Ashprakpham
Prakhexsha
Patromlo
Mochuhex
Junshapat
Prakshachu
Ashlobi
Patjunkee
Molopat
Prakkeebi
Romprakpham
Phamkeeprak
Prakrombi
Romjunpham
Biprakthur
Loromjun
Junthurprak
Moshakee
Biprakrom
Shahexmo
Romhexsha
Junchuthur
Prakshahex
Thurpathex
Lopatthur
Lomothur
Phamjunlo
Chuphamash
Prakgraypham
Lothurpham
Mobiprak
Grayashmo
Patashrom
Patshathur
Hexgrayash
Biashprak
Ashpraklo
Phamchupat
Graykeelo
Bihexpat
Chushamo
Rompraklo
Mograychu
Moashrom
Patmochu
Phamjunkee
Keeshaash
Moshalo
Thurchusha
Bigraypham
Shamohex
Bichuash
Grayrompat
Keelorom
Romhexpham
Jungraymo
Ashkeegray
Junlohex
Shamojun
Phambigray
Romthurgray
Phamprakgray
Keebilo
Romchumo
Ashgrayrom
Patashgray
Moshathur
Ashphamchu
Phampathex
Moshapham
Grayashchu
Phamshalo
Hexthurmo
Prakkeechu
Junthurlo
Patjunlo
Chumoprak
Thurprakbi
Thurphamgray
Hexpatrom
Grayhexchu
Moprakpham
Phamthurkee
Mograykee
Graykeesha
Biashsha
Junhexmo
Ashphamjun
Loshapham
Romlojun
Shathurkee
Junmochu
Lochumo
Patgraychu
Chubisha
Chumogray
Graythurrom
Prakpatjun
Hexchukee
Thurkeehex
Junthurash
Lomochu
Graykeejun
Junprakhex
Chuhexmo
Lokeechu
Bishakee
Mopatkee
Phamthurrom
Junthurkee
Shahexkee
Ashhexkee
Junromash
Patjunmo
Prakthurlo
Bikeejun
Romchupat
Junpatkee
Patromsha
Romphamthur
Lobiash
Junbimo
Junshapham
Shachupham
Keegraychu
Shakeegray
Prakjunsha
Bipatthur
Patphamsha
Pathexprak
Shapatkee
Hexlogray
Sharomkee
Junprakkee
Mochurom
Bimokee
Patlomo
Thurpatjun
Phamthurbi
Hexromsha
Keeshagray
Biashrom
Keepatprak
Ashshajun
Ashjunpham
Ashromthur
Graykeehex
Keegraypat
Prakshakee
Shapatbi
Hexprakrom
Graythurpat
Chuphamkee
Romthurhex
Lopatrom
Ashthurmo
Grayjunchu
Junashhex
Ashhexmo
Lohexrom
Mokeeash
Grayromchu
Phamthurchu
Grayshathur
Prakthurchu
Mochupham
Hexprakbi
Ashhexpham
Ashprakrom
Phammochu
Moashlo
Chukeebi
Graythurkee
Thurlopham
Phamprakjun
Lopatjun
Keeashpham
Keephamthur
Keejunpat
Thurpatlo
Patkeepham
Keejunhex
Prakpatgray
Thurrommo
Patthursha
Lograyprak
Phamromgray
Grayphamjun
Bipatrom
Ashthurchu
Phamthurpat
Patgraythur
Mograyprak
Chukeejun
Biprakjun
Hexlokee
Keepathex
Hexkeepham
Rompatgray
Loashpat
Phamchulo
Hexmogray
Moprakhex
Hexprakthur
Ashjunprak
Chuphamthur
Thurjunpham
Shathurbi
Moshapat
Keemoash
Bimosha
Bihexprak
Junshachu
Thurpatkee
Chushaprak
Phamshapat
Pathexsha
Thurprakrom
Chujunpham
Ashpatmo
Graylokee
Loromhex
Prakashchu
Ashprakkee
Romshaash
Keebirom
Bimoprak
Prakashpat
Graykeeprak
Chugraybi
Jungraypham
Chupathex
Graykeeash
Shamokee
Shagraylo
Pathexbi
Prakmokee
Bishajun
Mophamthur
Romkeesha
Thurgraychu
Keeashpat
Phamhexmo
Ashshahex
Thurbiash
Chukeeash
Keeromchu
Grayshahex
Patbiprak
Bishathur
Romchubi
Ashhexthur
Hexbisha
Pathexpham
Patashchu
Junphambi
Patthurbi
Thurphamjun
Chubipat
Prakjunbi
Prakromkee
Phambipat
Graybisha
Lomosha
Ashpatbi
Lojunmo
Hexbilo
Churomlo
Junhexthur
Rompatlo
Prakromchu
Prakbipat
Shaashprak
Chubijun
Bilokee
Junthurpham
Hexchulo
Thurshapat
Mochulo
Romchuash
Grayrommo
Thurjunpat
Grayphamsha
Grayromash
Moshagray
Thurlogray
Hexprakpham
Hexashlo
Graypatmo
Bithurlo
Prakashgray
Shagrayash
Romkeegray
Hexashprak
Patromprak
Thurashprak
Hexphamash
Chujunprak
Lopatmo
Chubiash
Keechupham
Keeshalo
Romgrayjun
Prakphamrom
Rommochu
Chuashgray
Patjunbi
Ashmopat
Pathexjun
Prakshapham
Patchujun
Patchubi
Pathexrom
Hexphambi
Shaprakkee
Chuashjun
Phamjunthur
Lobipat
Ashmojun
Bihexlo
Thurmoprak
Shathurmo
Thurromprak
Romkeeash
Junchupham
Bichusha
Patromgray
Hexthursha
Lograythur
Ashrommo
Hexromprak
Romthursha
Junlokee
Chuhexbi
Prakshagray
Thurbisha
Praklojun
Chushapham
Phamlokee
Junpatpham
Rombisha
Lochugray
Prakashkee
Romphammo
Thurphammo
Phamkeepat
Bithurrom
Hexphampat
Patprakjun
Chujunkee
Mopatash
Keejunash
Phamchuthur
Biromprak
Jungraylo
Romthurjun
Prakthurash
Junphamlo
Churomsha
Grayromjun
Hexphamkee
Patshakee
Keejunthur
Patmolo
Patprakthur
Junbiash
Grayloash
Junmothur
Hexashpat
Prakpatkee
Shakeepat
Chugraylo
Shabichu
Chumohex
Moprakjun
Thurromkee
Phamprakhex
Thurchukee
Hexmothur
Chuphambi
Romshachu
Patbikee
Junpatprak
Lohexbi
Phamkeemo
Junloash
Romgrayprak
Rommoash
Shaloash
Prakthurmo
Phamprakmo
Prakphamjun
Ashpatrom
Shaashjun
Romchulo
Shaprakgray
Loprakthur
Prakhexpham
Romphamprak
Ashromgray
Junlosha
Graylobi
Chujungray
Mokeesha
Shakeebi
Patprakkee
Lochuprak
Thurbikee
Patkeegray
Romashprak
Junpatsha
Prakkeelo
Shachumo
Phammokee
Romshamo
Grayshajun
Thurbichu
Thurromhex
Phambichu
Bipatsha
Phamashlo
Phampatthur
Shaashhex
Mopatrom
Thurchuprak
Chukeerom
Ashchuhex
Chuhexprak
Keechuprak
Grayprakchu
Thurjunash
Ashmobi
Romjunsha
Patchuash
Romphamlo
Hexkeeash
Thurprakjun
Shahexgray
Mopatlo
Rombipat
Graythurpham
Biromkee
Romkeelo
Ashmochu
Prakbithur
Prakromthur"""

res = 0
ewoks = input.splitlines()
for ewok in ewoks:
    if ewok.find("a") == -1 and ewok.find("A"):
        res = res + 1
print(res)