#include #include using namespace std; int main() { string s; cin >> s; int firstA[200005],secondA[200005]; int firstB[200005],secondB[200005]; int a = 0,b=0; for(int i=0;i=b) { if(firstA[a-b] == -1)firstA[a-b]=i+1; else secondA[a-b] = i+1; } else { if(firstB[b-a] == -1)firstB[b-a]=i+1; else secondA[b-a] = i+1; } } int ans = 0; for(int i=0;i