import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        //int あ = 10;
         Scanner scan = new Scanner(System.in);
 
        
        int p = scan.nextInt();
        int q = scan.nextInt();
        int r = scan.nextInt();
        
        if(p+q<q+r){
            if(p+q<p+r){
                System.out.println(p+q);
            }
            else{
                System.out.println(r+p);
            }
        }
        else{
            if(q+r<p+r){
                System.out.println(q+r);
            }
            else{
                System.out.println(r+p);
            }
        }
        

    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws Exception {
        //int あ = 10;
         Scanner scan = new Scanner(System.in);
 
        
        int p = scan.nextInt();
        int q = scan.nextInt();
        int r = scan.nextInt();
        
        if(p+q<q+r){
            if(p+q<p+r){
                System.out.println(p+q);
            }
            else{
                System.out.println(r+p);
            }
        }
        else{
            if(q+r<p+r){
                System.out.println(q+r);
            }
            else{
                System.out.println(r+p);
            }
        }
        

    }
} Main public static void main(String[] args) throws Exception {
        //int あ = 10;
         Scanner scan = new Scanner(System.in);
 
        
        int p = scan.nextInt();
        int q = scan.nextInt();
        int r = scan.nextInt();
        
        if(p+q<q+r){
            if(p+q<p+r){
                System.out.println(p+q);
            }
            else{
                System.out.println(r+p);
            }
        }
        else{
            if(q+r<p+r){
                System.out.println(q+r);
            }
            else{
                System.out.println(r+p);
            }
        }
        

    } main {
        //int あ = 10;
         Scanner scan = new Scanner(System.in);
 
        
        int p = scan.nextInt();
        int q = scan.nextInt();
        int r = scan.nextInt();
        
        if(p+q<q+r){
            if(p+q<p+r){
                System.out.println(p+q);
            }
            else{
                System.out.println(r+p);
            }
        }
        else{
            if(q+r<p+r){
                System.out.println(q+r);
            }
            else{
                System.out.println(r+p);
            }
        }
        

    } 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 if(p+q<q+r){
            if(p+q<p+r){
                System.out.println(p+q);
            }
            else{
                System.out.println(r+p);
            }
        }
        else{
            if(q+r<p+r){
                System.out.println(q+r);
            }
            else{
                System.out.println(r+p);
            }
        } p+q<q+r p+q p q q+r q r {
            if(p+q<p+r){
                System.out.println(p+q);
            }
            else{
                System.out.println(r+p);
            }
        } if(p+q<p+r){
                System.out.println(p+q);
            }
            else{
                System.out.println(r+p);
            } p+q<p+r p+q p q p+r p r {
                System.out.println(p+q);
            } System.out.println(p+q) System.out.println System.out System System.out p+q p q {
                System.out.println(r+p);
            } System.out.println(r+p) System.out.println System.out System System.out r+p r p {
            if(q+r<p+r){
                System.out.println(q+r);
            }
            else{
                System.out.println(r+p);
            }
        } if(q+r<p+r){
                System.out.println(q+r);
            }
            else{
                System.out.println(r+p);
            } q+r<p+r q+r q r p+r p r {
                System.out.println(q+r);
            } System.out.println(q+r) System.out.println System.out System System.out q+r q r {
                System.out.println(r+p);
            } System.out.println(r+p) System.out.println System.out System System.out r+p r p String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        //int あ = 10;
         Scanner scan = new Scanner(System.in);
 
        
        int p = scan.nextInt();
        int q = scan.nextInt();
        int r = scan.nextInt();
        
        if(p+q<q+r){
            if(p+q<p+r){
                System.out.println(p+q);
            }
            else{
                System.out.println(r+p);
            }
        }
        else{
            if(q+r<p+r){
                System.out.println(q+r);
            }
            else{
                System.out.println(r+p);
            }
        }
        

    }
} public class Main {
    public static void main(String[] args) throws Exception {
        //int あ = 10;
         Scanner scan = new Scanner(System.in);
 
        
        int p = scan.nextInt();
        int q = scan.nextInt();
        int r = scan.nextInt();
        
        if(p+q<q+r){
            if(p+q<p+r){
                System.out.println(p+q);
            }
            else{
                System.out.println(r+p);
            }
        }
        else{
            if(q+r<p+r){
                System.out.println(q+r);
            }
            else{
                System.out.println(r+p);
            }
        }
        

    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        //int あ = 10;
         Scanner scan = new Scanner(System.in);
 
        
        int p = scan.nextInt();
        int q = scan.nextInt();
        int r = scan.nextInt();
        
        if(p+q<q+r){
            if(p+q<p+r){
                System.out.println(p+q);
            }
            else{
                System.out.println(r+p);
            }
        }
        else{
            if(q+r<p+r){
                System.out.println(q+r);
            }
            else{
                System.out.println(r+p);
            }
        }
        

    }
}
