aboutsummaryrefslogtreecommitdiff
path: root/cses/IntroductoryProblems/Repetitions/main.cpp
blob: cc45f6393968c66bd1b09e08e9b0833d211bc589 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<bits/stdc++.h>

using namespace std;

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
  string s;
  cin >> s;
  int mx = 1;
  int cnt = 1;
  for (int i = 0; i < s.length() - 1; ++i) {
    if(s[i] == s[i + 1]) {
      cnt++;
      mx = max(mx, cnt);
    } else {
        cnt = 1;
    }
  }
  cout << mx << endl;
}