#include #include using namespace std; int main(){ int d; cin >> d; string a, b; cin >> a >> b; string str = a + b; int count, result; for(int i = 1; i <= 14; i++){ for(int j = 0; j < 15 - i; j++){ count = 0; for(int k = 0; k < i; k++){ if(str[j + k] == 'x') count++; } if(count <= d){ result = i; break; } } } cout << result << endl; }