p, q, r = map(int, input().split())
m = p + q
if m > min(q + r, r + p):
    m = min(q + r, r + p)
print(m) p, q, r = map(int, input().split()) p map(int, input().split()) map int input().split() ().split () input split q r m = p + q m p + q p q if m > min(q + r, r + p):
    m = min(q + r, r + p) m > min(q + r, r + p) m min(q + r, r + p) min q + r q r r + p r p m = min(q + r, r + p) m min(q + r, r + p) min q + r q r r + p r p print(m) print m q, r = map(int, input().split()) map(int, input().split()) q m = min(q + r, r + p) min(q + r, r + p) m p, q, r = map(int, input().split()) map(int, input().split()) p m = p + q p + q m r = map(int, input().split()) map(int, input().split()) r
p, q, r = map(int, input().split())
m = p + q
if m > min(q + r, r + p):
    m = min(q + r, r + p)
print(m)