import java.util.*;
public 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 pq = p + q;
    int qr = q + r;
    int rp = r + p;
    
    int result = pq;
    if(qr < result){
      result = qr;
    }
    if(rp < result){
      result = rp;
    }
    // 出力
    System.out.println(result);
  }
} import java.util.*; util.* java public 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 pq = p + q;
    int qr = q + r;
    int rp = r + p;
    
    int result = pq;
    if(qr < result){
      result = qr;
    }
    if(rp < result){
      result = rp;
    }
    // 出力
    System.out.println(result);
  }
} 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 pq = p + q;
    int qr = q + r;
    int rp = r + p;
    
    int result = pq;
    if(qr < result){
      result = qr;
    }
    if(rp < result){
      result = rp;
    }
    // 出力
    System.out.println(result);
  } main {
    Scanner sc = new Scanner(System.in);
    // 整数の入力
    int p = sc.nextInt();
    int q = sc.nextInt();
    int r = sc.nextInt();
    int pq = p + q;
    int qr = q + r;
    int rp = r + p;
    
    int result = pq;
    if(qr < result){
      result = qr;
    }
    if(rp < result){
      result = rp;
    }
    // 出力
    System.out.println(result);
  } 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 pq = p + q; pq p + q p q int qr = q + r; qr q + r q r int rp = r + p; rp r + p r p int result = pq; result pq if(qr < result){
      result = qr;
    } qr < result qr result {
      result = qr;
    } result = qr result qr if(rp < result){
      result = rp;
    } rp < result rp result {
      result = rp;
    } result = rp result rp System.out.println(result) System.out.println System.out System System.out result String[] args args public 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 pq = p + q;
    int qr = q + r;
    int rp = r + p;
    
    int result = pq;
    if(qr < result){
      result = qr;
    }
    if(rp < result){
      result = rp;
    }
    // 出力
    System.out.println(result);
  }
} public 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 pq = p + q;
    int qr = q + r;
    int rp = r + p;
    
    int result = pq;
    if(qr < result){
      result = qr;
    }
    if(rp < result){
      result = rp;
    }
    // 出力
    System.out.println(result);
  }
} Main
import java.util.*;
public 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 pq = p + q;
    int qr = q + r;
    int rp = r + p;
    
    int result = pq;
    if(qr < result){
      result = qr;
    }
    if(rp < result){
      result = rp;
    }
    // 出力
    System.out.println(result);
  }
}
