S = list(map(int, input().split()))
P = S[0]
Q = S[1]
R = S[2]
print(min(P+Q, Q+R, R+P)) S = list(map(int, input().split())) S list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split P = S[0] P S[0] S 0 Q = S[1] Q S[1] S 1 R = S[2] R S[2] S 2 print(min(P+Q, Q+R, R+P)) print min(P+Q, Q+R, R+P) min P+Q P Q Q+R Q R R+P R P R = S[2] S[2] R Q = S[1] S[1] Q S = list(map(int, input().split())) list(map(int, input().split())) S P = S[0] S[0] P
S = list(map(int, input().split()))
P = S[0]
Q = S[1]
R = S[2]
print(min(P+Q, Q+R, R+P))