package ru.redguy.tasks;

import ru.redguy.ATask;
import ru.redguy.Task;

import java.io.IOException;

@ATask("2506")
public class Task2506 extends Task {
    @Override
    public void run() throws IOException {
        String s = getFile("k7.txt");
        int line = 0;
        for (int i = 0; i < s.length(); i++) {
            String sub = s.substring(i);
            int bingo = 0;
            for (int j = 0; j < sub.length(); j++) {
                if(sub.charAt(j) == 'C') {
                    bingo++;
                } else {
                    if(line < bingo) line = bingo;
                    break;
                }
            }
        }
        System.out.println(line);
    }
}
