There are three airports A, B and C, and flights between each pair of airports in both directions.
A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours.
Consider a route where we start at one of the airports, fly to another airport and then fly to the other airport.
What is the minimum possible sum of the flight times?

-----Constraints-----
 - 1 \leq P,Q,R \leq 100
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
P Q R

-----Output-----
Print the minimum possible sum of the flight times.

-----Sample Input-----
1 3 4

-----Sample Output-----
4

 - The sum of the flight times in the route A \rightarrow B \rightarrow C: 1 + 3 = 4 hours
 - The sum of the flight times in the route A \rightarrow C \rightarrow C: 4 + 3 = 7 hours
 - The sum of the flight times in the route B \rightarrow A \rightarrow C: 1 + 4 = 5 hours
 - The sum of the flight times in the route B \rightarrow C \rightarrow A: 3 + 4 = 7 hours
 - The sum of the flight times in the route C \rightarrow A \rightarrow B: 4 + 1 = 5 hours
 - The sum of the flight times in the route C \rightarrow B \rightarrow A: 3 + 1 = 4 hours
The minimum of these is 4 hours.

Difficulty: introductory

Starter code:

Solutions:
print((sum(sorted(list(map(int,input().split())))[0:2])))



p,q,r = map(int, input().split())

print(min(p+q,p+r,q+r))

p, q, r = map(int, input().split())
print(min(p + q, q + r, r + p))

import itertools
pqr = list(map(int, input().split()))
print(min([a+b for a, b in itertools.combinations(pqr, 2)]))

p, q, r = map(int, input().split())

print(min(p+q, q+r, r+p))

# import math
# import statistics
#a=input()
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#     c.append(int(i))
e1,e2,e3 = map(int,input().split())
#f = list(map(int,input().split()))
# g = [input() for _ in range(15)]
# zoro = int(a[0]*len(a))
A=e1+e2
B=e2+e3
C=e1+e3
print(min(A,B,C))

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

a, b, c = map(int, input().split())
print(a+b+c-max(a, b, c))

pqr = list(map(int, input().split()))
from itertools import permutations
ans = 100*3
for i, j in permutations(pqr, 2):
    ans = min(ans, i+j)
print(ans)

import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return list(map(int,input().split()))
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

a,b,c =I()
ans = min(a+b,b+c)
print((min(ans,a+c)))


P,Q,R=map(int,input().split())
if P<Q:P,Q=Q,P
if P<R:P,R=R,P
print(Q+R)

p,q,r = map(int, input().split())
l=[p+q,q+r,p+r]
print(min(l))

p = sorted(map(int, input().split()))

print((p[0] + p[1]))


P,Q,R = map(int,input().split())
print(min(P+Q,P+R,Q+R))

p, q, r = list(map(int, input().split()))
print((min(p+q, p+r, q+r)))


p,q,r = map(int, input().split())

# 飛行ルートは、p,q,r のみ。

# 結局はルートp＋r、p＋q、r＋qの内から最小のものを選ぶ
print(min([p+r, p+q, r+q]))

P, Q, R = list(map(int, input().split()))

list_m = [P+Q,R+Q,P+R,Q+R,R+P,Q+P]

min = 200
for i in range(0,len(list_m)):
    if min > int(list_m[i]):
        min = list_m[i]

print(min)


dist = list(map(int, input().split()))
dist.sort()
print(dist[0]+ dist[1])

s = list(map(int, input().split()))
s.sort()

print(s[0]+s[1])

p,q,r=map(int,input().split())
print(min(p+q,p+r,q+r))

a = list(map(int,input().split()))
print(sum(a)-max(a))

S_list = list(map(int,input().split()))
sum_1 = sum(S_list)
S_list_1 = [sum_1 - i for i in S_list] 
print(min(S_list_1))  

n, a, b = map(int, input().split())
print(min(n + a, a + b, b + n))


url = "https://atcoder.jp//contests/abc129/tasks/abc129_a"

def main():
    p, q, r = list(map(int, input().split()))
    print((sum([p,q,r]) - max(p,q,r)))

def __starting_point():
    main()

__starting_point()

P, Q, R = map(int, input().split())
 
print(P + Q + R - max(P, Q, R))

l=list(map(int,input().split()))
l.sort()
print(l[0]+l[1])

a,b,c = map(int,input().split())

ans = a + b
if a + c < ans:
  ans = a + c
if b + c < ans:
  ans = b + c

print(ans)

p,q,r=map(int,input().split())
print(p+q+r-max(p,q,r))

l=list(map(int,input().split(' ')))
l=sorted(l)
print((l[0]+l[1]))


a,b,c=map(int,input().split())
print(min(a+b,b+c,a+c))

# A - Airplane
# https://atcoder.jp/contests/abc129/tasks/abc129_a

ABC = list(map(int, input().split()))
ABC.sort()
print((ABC[0] + ABC[1]))


P, Q, R = map(int, input().split())

sums = [P + Q, R + Q, Q + R, P + R, R + P, Q + P]

print(min(sums))

time_list = list(map(int,input().split()))

time_list.sort()

print(time_list[0]+time_list[1])

p,q,r = map(int,input().split())
print(min(p+q,q+r,r+p))

l = list(map(int,input().split()))
l.sort()
print(l[0] + l[1])

a = list(map(int,input().split()))
print((min(a[0]+a[1],a[1]+a[2],a[2]+a[0])))


# 129a

def atc_129a(input_value: str) -> int:
    PQR = input_value.split(" ")
    P = int(PQR[0])
    Q = int(PQR[1])
    R = int(PQR[2])

    return min(P + Q, P + R, Q + R)

input_value = input()
print(atc_129a(input_value))

#ABC129
p,q,r = map(int,input().split())
print(min(p+r,r+q,p+q))

A=list(map(int,input().split()));print(sum(A)-max(A))

t = list(map(int,input().split()))
t.sort()
print(t[0]+t[1])

3
import sys
input = lambda: sys.stdin.readline().strip()
p, q, r = [int(x) for x in input().split()]
print(min(p + q, q + r, r + p))

p=sorted(list(map(int,input().split())))
print(p[0]+p[1])

p, q, r = list(map(int, input().split()))
print((p + q + r - max(p, q, r)))


a,s,d=map(int, input().split())

print(min(a+s,s+d,d+a))

P,Q,R = list(map(int,input().split()))

flight = [P + Q, P + R, Q + R]
print((min(flight)))


P,Q,R = map(int,input().split())
A = [P,Q,R]
A.sort()
print(A[1]+A[0])

pqr = list(map(int, input().split()))
pqr.sort()
print(pqr[0] + pqr[1])

A, B, C = map(int,input().split())

list = [A+B,B+C,A+C]
new_list = sorted(list)

print(new_list[0])

l_d = list(map(int, input().split()))
l_d.sort()
min_d = l_d[0] + l_d[1]
print(min_d)

p, q, r = list(map(int, input().split()))
print((min(p + q, r + q, p + r)))


p,q,r=map(int,input().split())
 
 
s=[p+q,p+r,q+r]
 
print(min(s))



P, Q, R = list(map(int, input().split()))



abc = P + Q
acb = Q + R
bca = P + R
print((min(abc, acb, bca)))


pqr = list(map(int, input().split()))

ans = float("inf")
for i in range(2):
  for j in range(i+1,3):
    t = pqr[i]+pqr[j]
    if t < ans: ans = t
print(ans)

# AtCoder Beginner Contest 129
# A - Airplane

a=list(map(int,input().split()))
a.sort()
print((sum(a[0:2])))


p,q,r = map(int, input().split())
print(min(p+q,p+r,q+r))

route=list(map(int,input().split()))

route.sort()
print(sum(route[:2]))

P, Q, R = map(int, input().split())

time = [P + Q, P + R, Q + R]

print(min(time))

P, Q, R = map(int, input().split())
max_d = max(P, max(Q, R))
total = P + Q + R - max_d

print(total)

list_plane = list(map(int, input().split()))
list_plane.sort()
print(list_plane[0] + list_plane[1])

p,q,r = map(int,input().split())
n = p+q+r
n -= max(p,q,r)
print(n)

a,b,c = map(int,input().split())
x = []
x.append(a+b)
x.append(a+c)
x.append(b+c)
print(sorted(x)[0])

P,Q,R = map(int,input().split())
print(min(P+Q,P+R,Q+R))

P, Q, R = map(int, input().split())
print(min(P+Q,Q+R,R+P))

p, q, r = list(map(int, input().split()))

a_c = p + q
a_b = r + q
b_c = p + r

minimum_time=min(a_c,a_b,b_c)

print(minimum_time)


pqr = list(map(int, input().split()))
pqr.sort()
print((pqr[0] + pqr[1]))


fly_times = [ int(v) for v in input().split(" ") ]

min_t = 10**9

for i in range(3):
  result = 0
  for j in range(3):
    if i == j:
      continue
    result += fly_times[j]
  if result < min_t:
    min_t = result


print(min_t)

p, q, r = list(map(int, input().split()))

print((min(p+q, min(q+r, r+p))))


ans = [int(n) for n in input().split()]
print(sum(ans)-max(ans))

P, Q, R = map(int, input().split())

ans = [P+Q, Q+R, R+P]
print(min(ans))

a = list(map(int, input().split()))
a.sort()

print(a[0] + a[1])

P,Q,R = map(int,input().split())
print(min(P+Q,min(Q+R,R+P)))

import itertools
P, Q, R = map(int, input().split())
lst = [P, Q, R]
c = list(itertools.combinations(lst, 2))
lst2 = []
for i in c:
    s = sum(i)
    lst2.append(s)
print(min(lst2))

P, Q, R = map(int, input().split())
print(P + Q + R - max(P, Q, R))

P, Q, R = map(int, input().split())

print(min(P + Q, Q + R, P + R))

byte = list(map(int, input().split()))
byte.sort()

print((byte[0] + byte[1]))


l = list(map(int,input().split()))
l.sort()
print(l[0]+l[1])

P, Q, R = map(int, input().split())

print(min(P+Q, Q+R, R+P))

P,Q,R=map(int, input().split())

print(min(P+Q,Q+R,R+P))

p,q,r=map(int,input().split())
print(min(p+q,q+r,r+p))

P, Q, R = map(int, input().split())
print(P+Q+R-(max(P, Q, R)))

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


p,q,r=map(int,input().split())

sum=[10**4] * 3
sum[0]=p+q
sum[1]=p+r
sum[2]=q+r
print(min(sum))

P, Q, R = map(int, input().split())

print(min(P+Q, Q+R,R+P))

# 空港 A, B, C があり、それぞれの空港の間では、双方向に飛行機が運航しています。
# 空港 A, B 間の飛行時間は片道 P 時間、空港 B, C 間の飛行時間は片道 Q 時間、空港 C, A 間の飛行時間は片道 R 時間です。
# いずれかの空港からスタートして他の空港に飛行機で移動し、さらにそのどちらでもない空港に飛行機で移動するような経路を考えます。
# 飛行時間の和は最短で何時間になるでしょうか。

P,Q,R = map(int,input().split())

print(min(P + Q, P + R, Q + R))

V = list(map(int, input().split()))

print(sum(V) - max(V))

p,q ,r=map(int,input().split())
print(min(p+q,p+r,r+q))

lst = sorted([int(x) for x in input().split()])

print((sum(lst[:2])))


P,Q,R = map(int,input().split())
print(min(P+Q,min(Q+R,R+P)))

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

print((sum([P, Q, R]) - max(P, Q, R)))


p,q,r = map(int, input().split())
print(min([p+r, p+q, r+q]))

p, q, r = list(map(int, input().split()))
time = [p, q, r]

print((sum(time) - max(time)))


p = sorted(list(map(int,input().split())))
print(p[0]+p[1])

P, Q, R = map(int,input().split())

Flight_time = [P+Q, Q+R, R+P]

print(min(Flight_time))

P,Q,R=map(int,input().split())
print(min(P+Q,P+R,R+Q))

p,q,r = map(int,input().split())
ans = p+q+r-max(p,q,r)
print(ans)

P, Q, R = map(int,input().split())

time = [P+Q,P+R,R+Q]
time.sort()
print(time[0])

a,b,c = map(int,input().split())

print(min(a+b,a+c,b+c))

q = list(map(int,input().split()))
q = sorted(q)
print(q[0] + q[1])