import core.bitop; import std.algorithm; import std.array; import std.ascii; import std.container; import std.conv; import std.format; import std.math; import std.random; import std.range; import std.stdio; import std.string; import std.typecons; void main() { string s = readln.chomp; int ans = 0; foreach (int i, c; s) { int sub = 0; foreach (int j; 0..cast(int)s.length) { int left = i - j; if (left < 0) { break; } int right = i + j; if (right >= s.length) { break; } // stderr.writeln("\t", s[left], s[right], s[left] == s[right]); sub += s[left] == s[right]; } // stderr.writeln(i, " ", sub); ans = max(ans, sub); } ans = ans * 2 - 1; ans.writeln; }