import java.io.*;
import java.util.*;

public class Main{
    
    public static void main(String[] arg){
        Scanner scan =new Scanner(System.in);
        int p=scan.nextInt();
        int q=scan.nextInt();
        int r=scan.nextInt();

        int r1=p+q;
        int r2=p+r;
        int r3=q+r;

        if(r1<=r2 && r1<=r3) System.out.print(r1);
        else if(r2<=r1 && r2<=r3) System.out.print(r2);
        else System.out.print(r3);

    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main{
    
    public static void main(String[] arg){
        Scanner scan =new Scanner(System.in);
        int p=scan.nextInt();
        int q=scan.nextInt();
        int r=scan.nextInt();

        int r1=p+q;
        int r2=p+r;
        int r3=q+r;

        if(r1<=r2 && r1<=r3) System.out.print(r1);
        else if(r2<=r1 && r2<=r3) System.out.print(r2);
        else System.out.print(r3);

    }
} Main public static void main(String[] arg){
        Scanner scan =new Scanner(System.in);
        int p=scan.nextInt();
        int q=scan.nextInt();
        int r=scan.nextInt();

        int r1=p+q;
        int r2=p+r;
        int r3=q+r;

        if(r1<=r2 && r1<=r3) System.out.print(r1);
        else if(r2<=r1 && r2<=r3) System.out.print(r2);
        else System.out.print(r3);

    } main {
        Scanner scan =new Scanner(System.in);
        int p=scan.nextInt();
        int q=scan.nextInt();
        int r=scan.nextInt();

        int r1=p+q;
        int r2=p+r;
        int r3=q+r;

        if(r1<=r2 && r1<=r3) System.out.print(r1);
        else if(r2<=r1 && r2<=r3) System.out.print(r2);
        else System.out.print(r3);

    } 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 r1=p+q; r1 p+q p q int r2=p+r; r2 p+r p r int r3=q+r; r3 q+r q r if(r1<=r2 && r1<=r3) System.out.print(r1);
        else if(r2<=r1 && r2<=r3) System.out.print(r2);
        else System.out.print(r3); r1<=r2 && r1<=r3 r1<=r2 r1 r2 r1<=r3 r1 r3 System.out.print(r1) System.out.print System.out System System.out r1 if(r2<=r1 && r2<=r3) System.out.print(r2);
        else System.out.print(r3); r2<=r1 && r2<=r3 r2<=r1 r2 r1 r2<=r3 r2 r3 System.out.print(r2) System.out.print System.out System System.out r2 System.out.print(r3) System.out.print System.out System System.out r3 String[] arg arg public class Main{
    
    public static void main(String[] arg){
        Scanner scan =new Scanner(System.in);
        int p=scan.nextInt();
        int q=scan.nextInt();
        int r=scan.nextInt();

        int r1=p+q;
        int r2=p+r;
        int r3=q+r;

        if(r1<=r2 && r1<=r3) System.out.print(r1);
        else if(r2<=r1 && r2<=r3) System.out.print(r2);
        else System.out.print(r3);

    }
} public class Main{
    
    public static void main(String[] arg){
        Scanner scan =new Scanner(System.in);
        int p=scan.nextInt();
        int q=scan.nextInt();
        int r=scan.nextInt();

        int r1=p+q;
        int r2=p+r;
        int r3=q+r;

        if(r1<=r2 && r1<=r3) System.out.print(r1);
        else if(r2<=r1 && r2<=r3) System.out.print(r2);
        else System.out.print(r3);

    }
} Main
import java.io.*;
import java.util.*;

public class Main{
    
    public static void main(String[] arg){
        Scanner scan =new Scanner(System.in);
        int p=scan.nextInt();
        int q=scan.nextInt();
        int r=scan.nextInt();

        int r1=p+q;
        int r2=p+r;
        int r3=q+r;

        if(r1<=r2 && r1<=r3) System.out.print(r1);
        else if(r2<=r1 && r2<=r3) System.out.print(r2);
        else System.out.print(r3);

    }
}