signedmain(){ cin >> s; int ans = 0; for (int i = 0; i < s.size(); i++) { int l = i, r = i; ans += 1; while (true) { int p = -1; if (r != s.size() - 1) { r += 1; if (!mp[{l, r}]) { p = check(s.substr(l, r - l + 1)); if (p == 1) { mp[{l, r}] = true; ans += 1; } } } if (l != 0) { l -= 1; if (!mp[{l, r}]) { p = check(s.substr(l, r - l + 1)); if (p == 1) { mp[{l, r}] = true; ans += 1; } } } if (r != s.size() - 1 && l != 0) { if (!mp[{l, r}]) { p = check(s.substr(l, r - l + 1)); if (p == 1) { mp[{l, r}] = true; ans += 1; } } } if (p == -1) { break; } } } cout << ans; }