P,Q,R=[int(s) for s in input().split(" ")]

List=[P,Q,R,P]
Ans=[]
SUM=0

for i in range(3):
    SUM=List[i]+List[i+1]
    Ans.append(SUM)
    
print(min(Ans)) int(s) for s in input().split(" ") for s in input().split(" ") s input().split(" ") ().split () input split " " for s in input().split(" ") int(s) int s P,Q,R=[int(s) for s in input().split(" ")] P [int(s) for s in input().split(" ")] Q R List=[P,Q,R,P] List [P,Q,R,P] P Q R P Ans=[] Ans [] SUM=0 SUM 0 for i in range(3):
    SUM=List[i]+List[i+1]
    Ans.append(SUM)
     i range(3) range 3 SUM=List[i]+List[i+1] SUM List[i]+List[i+1] List[i] List i List[i+1] List i+1 i 1 Ans.append(SUM) Ans.append Ans append SUM print(min(Ans)) print min(Ans) min Ans Ans=[] [] Ans SUM=List[i]+List[i+1] List[i]+List[i+1] SUM SUM=0 0 SUM R=[int(s) for s in input().split(" ")] [int(s) for s in input().split(" ")] R P,Q,R=[int(s) for s in input().split(" ")] [int(s) for s in input().split(" ")] P Q,R=[int(s) for s in input().split(" ")] [int(s) for s in input().split(" ")] Q List=[P,Q,R,P] [P,Q,R,P] List
P,Q,R=[int(s) for s in input().split(" ")]

List=[P,Q,R,P]
Ans=[]
SUM=0

for i in range(3):
    SUM=List[i]+List[i+1]
    Ans.append(SUM)
    
print(min(Ans))