#include using namespace std; typedef long long ll; #define rep(i,n) for(int i=0;i<(int)(n);i++) int solve(int a) { int m = 0; while(a > 0) { int l = a&-a; int b=a&~(a+l); m=max(m,__builtin_popcount(b)); a^=b; } return m; } int main(){ int b = 0; int d;cin>>d; rep(i,2) { string s;cin>>s; rep(j, 7) { b |= s[j] == 'o' ? 1 << (i * 7 + j) : 0; } } int m=0; rep(i, 14){ rep(j,d) { int q=((1<