n = list(map(int, input().split()))
p = n[0]
q = n[1]
r = n[2]

x = p + q
y = q + r
z = r + p

print(min(x, y, z)) n = list(map(int, input().split())) n list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split p = n[0] p n[0] n 0 q = n[1] q n[1] n 1 r = n[2] r n[2] n 2 x = p + q x p + q p q y = q + r y q + r q r z = r + p z r + p r p print(min(x, y, z)) print min(x, y, z) min x y z z = r + p r + p z n = list(map(int, input().split())) list(map(int, input().split())) n q = n[1] n[1] q r = n[2] n[2] r p = n[0] n[0] p x = p + q p + q x y = q + r q + r y
n = list(map(int, input().split()))
p = n[0]
q = n[1]
r = n[2]

x = p + q
y = q + r
z = r + p

print(min(x, y, z))