Buggy python submission (verdict: Runtime Error):
N,A,B =map(int,input().split()) 

from collections import Counter

blues = 'b' * A
reds = 'r' * B

set_balls = blues + reds

all_balls = set_balls * ( N // ( A + B ) + 2 )

balls_N = all_balls[:N]

c = Counter(balls_N)
print(c['b'])


Fixed submission:
N,A,B =map(int,input().split()) 

# import collections

# blues = 'b' * A
# reds = 'r' * B

# set_balls = blues + reds

# all_balls = set_balls * ( N // ( A + B ) + 1 )

# balls_N = all_balls[:N]

# c = collections.Counter(balls_N)
# print(c['b'])

p = N//(A+B)

if N - p*(A+B) < A:
    print(A*p + N - p*(A+B) )
else:
    print(A*p+A)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
N,A,B =map(int,input().split()) 

blue = 'b' * A
red = 'r' * B

set_balls = blue + red
all_balls = set_balls* ( N // ( A + B ) + 1 )
all_balls = all_balls[:N]
c = Counter(all_balls)
print(c['b'])


Fixed submission:
N,A,B =map(int,input().split()) 

# import collections

# blues = 'b' * A
# reds = 'r' * B

# set_balls = blues + reds

# all_balls = set_balls * ( N // ( A + B ) + 1 )

# balls_N = all_balls[:N]

# c = collections.Counter(balls_N)
# print(c['b'])

p = N//(A+B)

if N - p*(A+B) < A:
    print(A*p + N - p*(A+B) )
else:
    print(A*p+A)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
N,A,B =map(int,input().split()) 

blue = 'b'*A
red= 'r'*B

set_balls =blue+red
all_balls = set_balls* ( N//(A+B) + 1 )
all_balls = all_balls[:N]
c = Counter(all_balls)
print(c['b'])


Fixed submission:
N,A,B =map(int,input().split()) 

# import collections

# blues = 'b' * A
# reds = 'r' * B

# set_balls = blues + reds

# all_balls = set_balls * ( N // ( A + B ) + 1 )

# balls_N = all_balls[:N]

# c = collections.Counter(balls_N)
# print(c['b'])

p = N//(A+B)

if N - p*(A+B) < A:
    print(A*p + N - p*(A+B) )
else:
    print(A*p+A)

Buggy python submission (verdict: Runtime Error):
import sys
from collections import Counter

# input処理を高速化する
input = sys.stdin.readline

N,A,B =map(int,input().split()) 

blue = 'b'*A
red= 'r'*B

set_balls =blue+red
all_balls = set_balls* ( N//(A+B) + 1 )
all_balls = all_balls[:N]
c = Counter(all_balls)
print(c['b'])


Fixed submission:
N,A,B =map(int,input().split()) 

# import collections

# blues = 'b' * A
# reds = 'r' * B

# set_balls = blues + reds

# all_balls = set_balls * ( N // ( A + B ) + 1 )

# balls_N = all_balls[:N]

# c = collections.Counter(balls_N)
# print(c['b'])

p = N//(A+B)

if N - p*(A+B) < A:
    print(A*p + N - p*(A+B) )
else:
    print(A*p+A)

Buggy python submission (verdict: Runtime Error):
import sys
from collections import Counter

# input処理を高速化する
input = sys.stdin.readline

N,A,B =map(int,input().split()) 

blue = 'b'*A
red= 'r'*B

ands =red+blue
alls = ands * (N//(A+B) + 1)
alls = alls[:N]
c = Counter(alls)
print(c['b'])


Fixed submission:
N,A,B =map(int,input().split()) 

# import collections

# blues = 'b' * A
# reds = 'r' * B

# set_balls = blues + reds

# all_balls = set_balls * ( N // ( A + B ) + 1 )

# balls_N = all_balls[:N]

# c = collections.Counter(balls_N)
# print(c['b'])

p = N//(A+B)

if N - p*(A+B) < A:
    print(A*p + N - p*(A+B) )
else:
    print(A*p+A)