#include #include #include #include using namespace std; int *file_vector; int main() { int file_length; string file; file_length = 0; int moznosti = 0; int nanic; cin >> file_length; cin >> file; // file = "XXXXXOOOOXXXXXXXX";// // file_length = file.size(); // cout << "file length" << file_length << "\n"; // if(nanic != file_length){ // cout << 0; // return 0; // } vector v; for(int x = 0; x < file.size(); x++){ char pismeno = file[x]; if(pismeno == 'X'){ v.push_back(1); } else { v.push_back(0); } } // cout << "sqrt(file_length)" << sqrt(file_length) << "\n"; for(int strana_a = 3; strana_a <= sqrt(file_length); strana_a++){ // cout << "strana: " << strana_a <<" \n"; int celkovy_obsah = pow(strana_a,2); int vnutorny_obsah = pow(strana_a- 2, 2); // for(int i = 0; i <= file.size() -pow(strana_a,2) ;i++){ // cout << "zaci atok iteracie index: " << i <<" \n"; int pocetx = 0; int poceto = 0; for(int x = i; x < i + pow(strana_a, 2); x++){ // cout << "index: " << x <<" \n"; if(v[x] == 0){ poceto++; } else { pocetx++; } } if(poceto == vnutorny_obsah && pocetx == celkovy_obsah - vnutorny_obsah){ // cout << "spravna\n"; moznosti++; } } }; cout << moznosti; return 0; }