#include using namespace std; const char die[9][10]={ "::::o::::", "::o:::o::", "o:::::::o", "::o:o:o::", "o:::o:::o", "o:o:::o:o", "o:o:o:o:o", "ooo:::ooo", "o:oo:oo:o" }; int main(){ cout.sync_with_stdio(false); char inputs[9]; bool result = true; int count = 0; for (int i = 0; i < 9; i++) cin >> inputs[i]; for (int i = 0; i < 9; i++){ for(int j = 0; j < 9; j++){ if (die[i][j] == 'o') count++; if(die[i][j] != inputs[j]) { result = false; break; } } if (result) { cout << count << '\n' ; break; } if (i != 8)result = true; count = 0; } if (!result) cout << "unknown\n" ; return 0; }