program airplane
  implicit none
  integer :: p,q,r,a,b,ans

  read *, p,q,r
  if (p<q) then
    a = p
    b = q
  else
    a = q
    b = p
  end if
  if (r > b) then
    ans = a + b
  else
    ans = a + r
  end if
  print '(i0)', ans
end program airplane
