import java.util.*;

public class Main{
  public static void main(String[] arts){
    Scanner scan = new Scanner(System.in);
    int p = scan.nextInt();
    int q = scan.nextInt();
    int r = scan.nextInt();
    
    int sum1 = p + q;
    int sum2 = p + r;
    int sum3 = q + r;
    
    if(sum1 <= sum2 && sum1 <= sum3){
      System.out.println(sum1);
    }else if(sum2 <= sum1 && sum2 <= sum3){
      System.out.println(sum2);
    }else{
      System.out.println(sum3);
    }
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] arts){
    Scanner scan = new Scanner(System.in);
    int p = scan.nextInt();
    int q = scan.nextInt();
    int r = scan.nextInt();
    
    int sum1 = p + q;
    int sum2 = p + r;
    int sum3 = q + r;
    
    if(sum1 <= sum2 && sum1 <= sum3){
      System.out.println(sum1);
    }else if(sum2 <= sum1 && sum2 <= sum3){
      System.out.println(sum2);
    }else{
      System.out.println(sum3);
    }
  }
} Main public static void main(String[] arts){
    Scanner scan = new Scanner(System.in);
    int p = scan.nextInt();
    int q = scan.nextInt();
    int r = scan.nextInt();
    
    int sum1 = p + q;
    int sum2 = p + r;
    int sum3 = q + r;
    
    if(sum1 <= sum2 && sum1 <= sum3){
      System.out.println(sum1);
    }else if(sum2 <= sum1 && sum2 <= sum3){
      System.out.println(sum2);
    }else{
      System.out.println(sum3);
    }
  } main {
    Scanner scan = new Scanner(System.in);
    int p = scan.nextInt();
    int q = scan.nextInt();
    int r = scan.nextInt();
    
    int sum1 = p + q;
    int sum2 = p + r;
    int sum3 = q + r;
    
    if(sum1 <= sum2 && sum1 <= sum3){
      System.out.println(sum1);
    }else if(sum2 <= sum1 && sum2 <= sum3){
      System.out.println(sum2);
    }else{
      System.out.println(sum3);
    }
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int p = scan.nextInt(); p scan.nextInt() scan.nextInt scan int q = scan.nextInt(); q scan.nextInt() scan.nextInt scan int r = scan.nextInt(); r scan.nextInt() scan.nextInt scan int sum1 = p + q; sum1 p + q p q int sum2 = p + r; sum2 p + r p r int sum3 = q + r; sum3 q + r q r if(sum1 <= sum2 && sum1 <= sum3){
      System.out.println(sum1);
    }else if(sum2 <= sum1 && sum2 <= sum3){
      System.out.println(sum2);
    }else{
      System.out.println(sum3);
    } sum1 <= sum2 && sum1 <= sum3 sum1 <= sum2 sum1 sum2 sum1 <= sum3 sum1 sum3 {
      System.out.println(sum1);
    } System.out.println(sum1) System.out.println System.out System System.out sum1 if(sum2 <= sum1 && sum2 <= sum3){
      System.out.println(sum2);
    }else{
      System.out.println(sum3);
    } sum2 <= sum1 && sum2 <= sum3 sum2 <= sum1 sum2 sum1 sum2 <= sum3 sum2 sum3 {
      System.out.println(sum2);
    } System.out.println(sum2) System.out.println System.out System System.out sum2 {
      System.out.println(sum3);
    } System.out.println(sum3) System.out.println System.out System System.out sum3 String[] arts arts public class Main{
  public static void main(String[] arts){
    Scanner scan = new Scanner(System.in);
    int p = scan.nextInt();
    int q = scan.nextInt();
    int r = scan.nextInt();
    
    int sum1 = p + q;
    int sum2 = p + r;
    int sum3 = q + r;
    
    if(sum1 <= sum2 && sum1 <= sum3){
      System.out.println(sum1);
    }else if(sum2 <= sum1 && sum2 <= sum3){
      System.out.println(sum2);
    }else{
      System.out.println(sum3);
    }
  }
} public class Main{
  public static void main(String[] arts){
    Scanner scan = new Scanner(System.in);
    int p = scan.nextInt();
    int q = scan.nextInt();
    int r = scan.nextInt();
    
    int sum1 = p + q;
    int sum2 = p + r;
    int sum3 = q + r;
    
    if(sum1 <= sum2 && sum1 <= sum3){
      System.out.println(sum1);
    }else if(sum2 <= sum1 && sum2 <= sum3){
      System.out.println(sum2);
    }else{
      System.out.println(sum3);
    }
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] arts){
    Scanner scan = new Scanner(System.in);
    int p = scan.nextInt();
    int q = scan.nextInt();
    int r = scan.nextInt();
    
    int sum1 = p + q;
    int sum2 = p + r;
    int sum3 = q + r;
    
    if(sum1 <= sum2 && sum1 <= sum3){
      System.out.println(sum1);
    }else if(sum2 <= sum1 && sum2 <= sum3){
      System.out.println(sum2);
    }else{
      System.out.println(sum3);
    }
  }
}