# -*- coding: utf-8 -*- ''' 問題の解釈がうまくできないのでやめる(好きではない問題だった) ''' D = int(input()) C = input() C += input() maru = batsu = 0 weekday = True cont_list = [] for c in C: if weekday and c=='o': maru += 1 elif weekday and c=='x': cont_list.append(maru) batsu = 1 weekday = False elif not weekday and c=='x': batsu += 1 elif not weekday and c=='o': cont_list.append(batsu) maru = 1 weekday = True if weekday: cont_list.append(maru) else: cont_list.append(batsu) ans = 0 for i in range(1, len(cont_list), 2): if D >= cont_list[i]: diff = D - cont_list[i] if cont_list[i-1]==0 and i+1