import java.util.*;
import java.math.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int p = sc.nextInt();
    int q=sc.nextInt();
    int r = sc.nextInt();
    int ans = p+q;
    int ans2 = q+r;
    int ans3 = Math.min(ans, ans2);
    System.out.println(Math.min(ans3, r+p));


  }
} import java.util.*; util.* java import java.math.*; math.* java class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int p = sc.nextInt();
    int q=sc.nextInt();
    int r = sc.nextInt();
    int ans = p+q;
    int ans2 = q+r;
    int ans3 = Math.min(ans, ans2);
    System.out.println(Math.min(ans3, r+p));


  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int p = sc.nextInt();
    int q=sc.nextInt();
    int r = sc.nextInt();
    int ans = p+q;
    int ans2 = q+r;
    int ans3 = Math.min(ans, ans2);
    System.out.println(Math.min(ans3, r+p));


  } main {
    Scanner sc = new Scanner(System.in);
    int p = sc.nextInt();
    int q=sc.nextInt();
    int r = sc.nextInt();
    int ans = p+q;
    int ans2 = q+r;
    int ans3 = Math.min(ans, ans2);
    System.out.println(Math.min(ans3, r+p));


  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int p = sc.nextInt(); p sc.nextInt() sc.nextInt sc int q=sc.nextInt(); q sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc int ans = p+q; ans p+q p q int ans2 = q+r; ans2 q+r q r int ans3 = Math.min(ans, ans2); ans3 Math.min(ans, ans2) Math.min Math ans ans2 System.out.println(Math.min(ans3, r+p)) System.out.println System.out System System.out Math.min(ans3, r+p) Math.min Math ans3 r+p r p String[] args args
import java.util.*;
import java.math.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int p = sc.nextInt();
    int q=sc.nextInt();
    int r = sc.nextInt();
    int ans = p+q;
    int ans2 = q+r;
    int ans3 = Math.min(ans, ans2);
    System.out.println(Math.min(ans3, r+p));


  }
}