#include using namespace std; int main() { bool arr[9]; bool t[9][9] = { {0, 0, 0, 0, 1, 0, 0, 0, 0}, {1, 0, 1, 0, 0, 0, 1, 0, 1}, {0, 0, 0, 1, 0, 1, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0, 1, 0}, {1, 0, 1, 0, 1, 0, 1, 0, 1}, {0, 0, 1, 0, 1, 0, 1, 0, 0}, {1, 0, 0, 0, 1, 0, 0, 0, 1}, {1, 0, 1, 1, 0, 1, 1, 0, 1}, {1, 1, 1, 0, 0, 0, 1, 1, 1} }; for (int i = 0; i < 9; i++) { string k; cin >> k; for (int j = 0; j < 3; j++) { arr[i] = k[j] == 'o' ? true : false; } } bool found; for (int i = 0; i < 9; i++) { found = true; for (int j = 0; j < 9; j++) { if (arr[j] != t[i][j]) { found = false; break; } } if (found) { int count = 0; for (int j = 0; j < 9; j++) { if (arr[j]) count++; } cout << count << endl; return 0; } } cout << "unknown" << endl; return 0; }