if __name__=='__main__':
    n = int(input())
    balls = input().strip()

    cnt_list = []

    parse_ball = balls.lstrip('R')
    cnt_list.append(parse_ball.count('R'))
    parse_ball = balls.lstrip('B')
    cnt_list.append(parse_ball.count('B'))
    parse_ball = balls.rstrip('R')
    cnt_list.append(parse_ball.count('R'))
    parse_ball = balls.rstrip('B')
    cnt_list.append(parse_ball.count('B'))

    print(min(cnt_list))

+ Recent posts