Buggy python submission (verdict: Runtime Error):
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
a_str='b'*A
b_str='r'*B
st=a_str+b_str
num=A+B
sum_str=''
sum_num=0

sum_str=st*N
b=sum_str[0:N]
print(b.count('b'))

Fixed submission:
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
b=int(N/(A+B))
ans=int(A*b)
if(N-b*(A+B)<=A):
    ans=ans+N-b*(A+B)
else:
    ans+=A
print(int(ans))

Buggy python submission (verdict: Runtime Error):
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
a_str='b'*A
b_str='r'*B
st=a_str+b_str
num=A+B
sum_str=''
sum_num=0

while sum_num<=N:
    sum_str+=st
    sum_num+=num
b=sum_str[0:N]
print(b.count('b'))

Fixed submission:
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
b=int(N/(A+B))
ans=int(A*b)
if(N-b*(A+B)<=A):
    ans=ans+N-b*(A+B)
else:
    ans+=A
print(int(ans))

Buggy python submission (verdict: Runtime Error):
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
st_a='b'*A
st_b='r'*B
d=st_a+st_b
e=A+B
if(N==0):
  print(0)
elif(A==0):
  print(0)
elif(B==0):
  print(N)
elif(e==0):
  print(0)
else:
  num=int(N/e)+2
  b=d*num
  c=b[0:N]
  print(c.count('b'))

Fixed submission:
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
b=int(N/(A+B))
ans=int(A*b)
if(N-b*(A+B)<=A):
    ans=ans+N-b*(A+B)
else:
    ans+=A
print(int(ans))

Buggy python submission (verdict: Runtime Error):
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
st_a='b'*A
st_b='r'*B
d=st_a+st_b
e=A+B
if(e==0):
  print(0)
else:
  num=int(N/e)+2
  b=d*num
  c=b[0:N]
  print(c.count('b'))

Fixed submission:
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
b=int(N/(A+B))
ans=int(A*b)
if(N-b*(A+B)<=A):
    ans=ans+N-b*(A+B)
else:
    ans+=A
print(int(ans))

Buggy python submission (verdict: Runtime Error):
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
st_a='b'*A
st_b='r'*B
d=st_a+st_b
e=A+B
if(e==0):
  print(0)
else:
  num=int(N/e)+2
  b=d*num
  print(b)
  c=b[0:N]
  print(c)
  print(c.count('b'))

Fixed submission:
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
b=int(N/(A+B))
ans=int(A*b)
if(N-b*(A+B)<=A):
    ans=ans+N-b*(A+B)
else:
    ans+=A
print(int(ans))

Buggy python submission (verdict: Runtime Error):
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
st_a='b'*A
st_b='r'*B
d=st_a+st_b
e=A+B
num=int(N/e)+1
b=d*num
c=b[0:N]
print(c.count('b'))

Fixed submission:
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
b=int(N/(A+B))
ans=int(A*b)
if(N-b*(A+B)<=A):
    ans=ans+N-b*(A+B)
else:
    ans+=A
print(int(ans))

Buggy python submission (verdict: Runtime Error):
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
st_a='b'*A
st_b='r'*B

sum=0
b=''
d=st_a+st_b
e=A+B
while sum<=N:
  sum+=e
  b+=d
c=b[0:N]
print(c.count('b'))

Fixed submission:
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
b=int(N/(A+B))
ans=int(A*b)
if(N-b*(A+B)<=A):
    ans=ans+N-b*(A+B)
else:
    ans+=A
print(int(ans))

Buggy python submission (verdict: Runtime Error):
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
st_a='b'*A
st_b='r'*B

sum=0
b=''
while sum<=N:
  b+=st_a
  sum+=A
  if(sum>=N):
    break
  b+=st_b
  sum+=B
c=b[0:N]
print(c.count('b'))

Fixed submission:
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
b=int(N/(A+B))
ans=int(A*b)
if(N-b*(A+B)<=A):
    ans=ans+N-b*(A+B)
else:
    ans+=A
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
st_a,st_b='',''
for i in range(A):
  st_a+='b'
for i in range(B):
  st_b+='r'
sum=0
b=''
while sum<=N:
  b+=st_a
  sum+=A
  if(sum>=N):
    break
  b+=st_b
  sum+=B
c=b[0:N]
print(c.count('b'))

Fixed submission:
a=input().split()
N,A,B=int(a[0]),int(a[1]),int(a[2])
b=int(N/(A+B))
ans=int(A*b)
if(N-b*(A+B)<=A):
    ans=ans+N-b*(A+B)
else:
    ans+=A
print(int(ans))