#include //#include"atcoder/all" #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #define all(a) (a).begin(),(a).end() using namespace std; //using namespace atcoder; int main(){ string s;cin >> s; int n=s.size(),i,j,k,ans = 10000; for(i=0;i