program abc129a
  implicit none
  integer :: p, q, r
  integer :: flight_time(3)

  read(*,*) p, q, r

  flight_time(1) = p + q  ! A->B->C
  flight_time(2) = r + q  ! A->C->B
  flight_time(3) = p + r  ! B->A->C

  print *, minval(flight_time(:), 1)

end program abc129a
