#include using namespace std; int main() { int ignore; cin >> ignore; string str; cin >> str; int ans = 0; for (size_t i = 3; i*i <= str.size(); ++i) { size_t size = i*i; size_t x = 0; size_t o = 0; for (size_t j = 0; j < size; ++j) { if (str[j] == 'X') { ++x; } else { ++o; } } if (x == 4 * i - 4) { ++ans; } if (o == 4 * i - 4) { ++ans; } for (size_t j = size; j < str.size(); ++j) { if (str[j] == 'X') { ++x; } else { ++o; } if (str[j - size] == 'X') { --x; } else { --o; } if (x == 4 * i - 4) { ++ans; } if (o == 4 * i - 4) { ++ans; } } } cout << ans << endl; return 0; }