a=3
b=4
c=5
old=a+b+c
if a>=1 and b>=2:
    a=a-1
    b=b-2  
if b>=1 and c>=2:
    b=b-1
    c=c-2  
new1=a+b+c
total1=old-new1
 
if b>=1 and c>=2:
    b=b-1
    c=c-2  
 
if a>=1 and b>=2:
    a=a-1
    b=b-2  
new2=a+b+c
total2=old-new2
 
if total1>=total2:
 print("" ,total1)
else:
    print("" ,total2)
    
    
    
a=1
b=0
c=5
old=a+b+c
if a>=1 and b>=2:
    a=a-1
    b=b-2  
if b>=1 and c>=2:
    b=b-1
    c=c-2  
new1=a+b+c
total1=old-new1
 
if b>=1 and c>=2:
    b=b-1
    c=c-2  
 
if a>=1 and b>=2:
    a=a-1
    b=b-2  
new2=a+b+c
total2=old-new2
 
if total1>=total2:
 print("" ,total1)
else:
    print("" ,total2)
    
    
a=5
b=4
c=2
old=a+b+c
if a>=1 and b>=2:
    a=a-1
    b=b-2  
if b>=1 and c>=2:
    b=b-1
    c=c-2  
new1=a+b+c
total1=old-new1
 
if b>=1 and c>=2:
    b=b-1
    c=c-2  
 
if a>=1 and b>=2:
    a=a-1
    b=b-2  
new2=a+b+c
total2=old-new2
 
if total1>=total2:
 print("" ,total1)
else:
    print("" ,total2)