#include #include #include using namespace std; typedef long long int ll; int main() { //ios::sync_with_stdio(false); ll ans = 0; char c; int prev_i = -1; int i = 0; int cur_ans = 0; while (c = getchar()) { if (c == EOF) { break; } bool is_one = c == '1'; if (is_one) { if (prev_i != -1) { cur_ans = i - prev_i; } prev_i = i; if (cur_ans > ans) { ans = cur_ans; } cur_ans = 0; } else { if (prev_i != -1) { cur_ans++; } } i++; } cout << ans / 2 << endl; }