P, Q, R = map(int, input().split())
if P >= Q and P >= R:
    print(Q + R)
elif Q >= P and Q >= R:
    print(P + R)
else:
    print(P + Q) P, Q, R = map(int, input().split()) P map(int, input().split()) map int input().split() ().split () input split Q R if P >= Q and P >= R:
    print(Q + R)
elif Q >= P and Q >= R:
    print(P + R)
else:
    print(P + Q) P >= Q and P >= R P >= Q P Q P >= R P R print(Q + R) print Q + R Q R elif Q >= P and Q >= R:
    print(P + R) Q >= P and Q >= R Q >= P Q P Q >= R Q R print(P + R) print P + R P R print(P + Q) print P + Q P Q P, Q, R = map(int, input().split()) map(int, input().split()) P R = map(int, input().split()) map(int, input().split()) R Q, R = map(int, input().split()) map(int, input().split()) Q
P, Q, R = map(int, input().split())
if P >= Q and P >= R:
    print(Q + R)
elif Q >= P and Q >= R:
    print(P + R)
else:
    print(P + Q)