import re

str_test = "caanqaaeamdwaagarapabseaawaabawaoaalaaaaaxxaapsxeaagragaaadawaoaanaawpqatdaaatakwsaaaayaaaaealabjxaaaeaaauamjawnsaataaaoaaqaxaaaaaeaajrahaaaaaadjaaqtewhspaaaaannaoaaaaaboaaaaaaaaaataqadihaaaaqawwaaazoaxaoapabuzwaaaaaaaahlaauakaaiyjavwcaasxaaturabanuataoikpkaoalaaaaaaafgaalwuxzaazaaltazjdaaasalraabaqjmaaadaaaaaaaaiauaqbajaaactaarwrcavmaaxxaqrxaaaaaaaeaaaqaajafaaadaciaaaakadraacafaahlaiaaaakefahalaaparxaaagaacnoraaytaloasaadaaaafataaoqarcazjmqeafajgaaaaaaavvaaaaaiaaaaiaaczrbalomaakgilacaayaayaxwaotaarlaxpaaraapaaaswhxxaajeagfaaaaeaaalaaaaeeaatoamayaaauaadaueccvaauvaakowasxaaatgnwaawtrxtudppfaaqfypaaaaanraiaaaynagqqaabdaayaaazaesasaaaaaaoaaaaacvawcasaiaaaavxafaqeaaadaciaaanujgxamxiaadazanaamaygabwrfazalaaawkpaalsaafiiataatavvaqaqzdatyaaaaanpsaaaajvaydxacyadaolabhocaaawaniniuaaakaaiaaanxaaxaccfaarlaakaabenevaaacaydaaxaaxepasmaasadabanaaafaalaladaagafaaaaaahagnixwemathayfagaxapkaaaafaasaacawaaaaackawamaaaawaatnaaoaaatbaniafawaalkaaumqzaoaauaamazaztamvdaxdaraeasaaaaachoavaaaqaajwaaaaaacarlaxaaapaaaaamfaaoeaoaaamapkacamraalbnavaaaxiaqazaamcmanagaicraawaaascbmraaavabaawaagqataazuaaaaakawxwazparaaaaaaaaasaiedhfaaaetaaaapaaapiaaaawembhmafalgayaaodamqazqwaasdeaappaacaarahnalaeaaaaanasasbzaaaaoaraeaazhaaevoiaazpypuggeayaapanzakaaaavzaacaaraaaaaaaxsvyacoxvttzgtbcuazxkuaaaiflbjzaaojaboxmaadkaaakzsbxaaaajanaatgaaaazarfaawujasaanxazowlfaayahaaaaaabdoayufltoaiabayaaafawiazaqaasaafchifgpjuvauaaayaaatvaxaaeaaharrazavlayaaaaaaagxcfaemvyaaaaaaulxajahazgapaasagswmahaapbaaafnaaywpagqiauaaaavbmgifaweatvaayhaadajaaaaragaminaafixwuaaexaajawzaazlaxastaatmdaaaaairfnraaaaaaaxaafgaattgakkaacioaabatahfqabmvzfzafifsbbnaaouaahalaahuaawaagataamarjgaaaamianabhaaaaaaiahtpxvaaaaaaahaahtgaaaazvafaaaavzkamalawaaqeaaaavgjkanenairaalazaaaayafsazaacodeawvamtdyaaaynaaxaazvssadaqdvstaaolcsecwszzaajahawajooaahgumavaabriwaazgrtaauaxpaaawbhaberaqltaaaaqaaaaxayldaaxgakmwmaaxxayualfaaijsaaaazxpaaaewcngnaaaypvmayaiaamaasaaakattsadqclclafadaaaadsnwdnaaqasataabasaataaaapajqatuakaygaaoamatgaacaaaaaljwzaaaqajafanaaxaagxqaaibgaslawuadeaaxbaweaxxaaaaesnaacatahaitatqsabkaaaaatlajpavaaadlnvzaeaascaaaahqmatanapciszqefcalacjraamhaaaaoanaganaaaaacaqcnaayaawaagazaayyaayjagasarbuafzpmpqeaohaaaglidaanrheaaaabnnaairalrbjuzaakaabgaeaadaaetaauaaaaazaadzxaaaagavazehulaauazvcaajcaaaaqgexaaaaajcirxauaahaoaaahohaanaayoaalukbaauaaaaioaaakcobkoaqdvalasraaawuaakaaaaaadamsaaaaaqakaanaxaaaiwaodazaanaaaravbqimznaataaesaavyqjakgabaeaiasamapaaaalwzaikpbclaaaacalakusaapaaaaqnaanaaahoaaaecaarwwaaaabxaaaaaepalaaaaaaaxaxgamawmalaaaaanqeaaaaxaomajaaaiavaaqxwaazaaaaaaaaapqpaaaaaastgdydwxaalahaiziaamauayaqaxyryaizkaefuaaaaaaaeaaanaaiaaaaayaaaaaaiywaaahaaaaajtawmanmadayaaawaaaaxagaaicaiagaaanaaakaodapaaaaabaaaaaadauevaaywbaaaaaaaaaaygaaawaazimwasraazoagvzpaabrnmlhqghhoaaanbaaanaaaaaqxauaaataaaabaahaaaafzaawaapaaaaaarazalqhobgzacazasauaaaaaujafowabywlaagaaadaaatamaaagnpmaeaaaaahmmxapanaraagsxoutbaaaauaqamlazaaaaaaaazaalnsacxltaavaaxpldaqqhapasmalaasutapuasaaatuloaaadaizmaaaaaqqyalyopwakaayhvyaaaczjeauavauxypyenmaaqiaaqiaahuaaakaauja"



def aSubstr(str):
	ls = []
	for l in re.split(r'[^aa]', str):
		if len(l)<2 or l == '':
			continue
		else:
			ls.append(l)
	count = len(ls)
	return count


print(aSubstr(str_test))

