import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int p = Integer.parseInt(str[0]);
    int q = Integer.parseInt(str[1]);
    int r = Integer.parseInt(str[2]);
    
    int ans = 0;
    System.out.println(Math.min(p+q,Math.min(q+r,p+r)));
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int p = Integer.parseInt(str[0]);
    int q = Integer.parseInt(str[1]);
    int r = Integer.parseInt(str[2]);
    
    int ans = 0;
    System.out.println(Math.min(p+q,Math.min(q+r,p+r)));
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int p = Integer.parseInt(str[0]);
    int q = Integer.parseInt(str[1]);
    int r = Integer.parseInt(str[2]);
    
    int ans = 0;
    System.out.println(Math.min(p+q,Math.min(q+r,p+r)));
  } main {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int p = Integer.parseInt(str[0]);
    int q = Integer.parseInt(str[1]);
    int r = Integer.parseInt(str[2]);
    
    int ans = 0;
    System.out.println(Math.min(p+q,Math.min(q+r,p+r)));
  } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String[] str = in.readLine().split(" "); str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int p = Integer.parseInt(str[0]); p Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int q = Integer.parseInt(str[1]); q Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 int r = Integer.parseInt(str[2]); r Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 int ans = 0; ans 0 System.out.println(Math.min(p+q,Math.min(q+r,p+r))) System.out.println System.out System System.out Math.min(p+q,Math.min(q+r,p+r)) Math.min Math p+q p q Math.min(q+r,p+r) Math.min Math q+r q r p+r p r String[] args args public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int p = Integer.parseInt(str[0]);
    int q = Integer.parseInt(str[1]);
    int r = Integer.parseInt(str[2]);
    
    int ans = 0;
    System.out.println(Math.min(p+q,Math.min(q+r,p+r)));
  }
} public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int p = Integer.parseInt(str[0]);
    int q = Integer.parseInt(str[1]);
    int r = Integer.parseInt(str[2]);
    
    int ans = 0;
    System.out.println(Math.min(p+q,Math.min(q+r,p+r)));
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int p = Integer.parseInt(str[0]);
    int q = Integer.parseInt(str[1]);
    int r = Integer.parseInt(str[2]);
    
    int ans = 0;
    System.out.println(Math.min(p+q,Math.min(q+r,p+r)));
  }
}