import java.util.*;

public class Main{

	public static void main(String[] args){
    	Scanner scanner = new Scanner(System.in);
        
        int P = scanner.nextInt(); // A-B
        int Q = scanner.nextInt(); // B-C
        int R = scanner.nextInt(); // C-A
        
        // A-B-C
        int t = P + Q;
        
        // C-A-B
        if(t > R+P){
        	t = R + P;
        }
        
        // B-C-A
        if(t > Q+R){
        	t = Q + R;
        }
        
        System.out.println(t);
    }

} import java.util.*; util.* java public class Main{

	public static void main(String[] args){
    	Scanner scanner = new Scanner(System.in);
        
        int P = scanner.nextInt(); // A-B
        int Q = scanner.nextInt(); // B-C
        int R = scanner.nextInt(); // C-A
        
        // A-B-C
        int t = P + Q;
        
        // C-A-B
        if(t > R+P){
        	t = R + P;
        }
        
        // B-C-A
        if(t > Q+R){
        	t = Q + R;
        }
        
        System.out.println(t);
    }

} Main public static void main(String[] args){
    	Scanner scanner = new Scanner(System.in);
        
        int P = scanner.nextInt(); // A-B
        int Q = scanner.nextInt(); // B-C
        int R = scanner.nextInt(); // C-A
        
        // A-B-C
        int t = P + Q;
        
        // C-A-B
        if(t > R+P){
        	t = R + P;
        }
        
        // B-C-A
        if(t > Q+R){
        	t = Q + R;
        }
        
        System.out.println(t);
    } main {
    	Scanner scanner = new Scanner(System.in);
        
        int P = scanner.nextInt(); // A-B
        int Q = scanner.nextInt(); // B-C
        int R = scanner.nextInt(); // C-A
        
        // A-B-C
        int t = P + Q;
        
        // C-A-B
        if(t > R+P){
        	t = R + P;
        }
        
        // B-C-A
        if(t > Q+R){
        	t = Q + R;
        }
        
        System.out.println(t);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int P = scanner.nextInt(); P scanner.nextInt() scanner.nextInt scanner int Q = scanner.nextInt(); Q scanner.nextInt() scanner.nextInt scanner int R = scanner.nextInt(); R scanner.nextInt() scanner.nextInt scanner int t = P + Q; t P + Q P Q if(t > R+P){
        	t = R + P;
        } t > R+P t R+P R P {
        	t = R + P;
        } t = R + P t R + P R P if(t > Q+R){
        	t = Q + R;
        } t > Q+R t Q+R Q R {
        	t = Q + R;
        } t = Q + R t Q + R Q R System.out.println(t) System.out.println System.out System System.out t String[] args args public class Main{

	public static void main(String[] args){
    	Scanner scanner = new Scanner(System.in);
        
        int P = scanner.nextInt(); // A-B
        int Q = scanner.nextInt(); // B-C
        int R = scanner.nextInt(); // C-A
        
        // A-B-C
        int t = P + Q;
        
        // C-A-B
        if(t > R+P){
        	t = R + P;
        }
        
        // B-C-A
        if(t > Q+R){
        	t = Q + R;
        }
        
        System.out.println(t);
    }

} public class Main{

	public static void main(String[] args){
    	Scanner scanner = new Scanner(System.in);
        
        int P = scanner.nextInt(); // A-B
        int Q = scanner.nextInt(); // B-C
        int R = scanner.nextInt(); // C-A
        
        // A-B-C
        int t = P + Q;
        
        // C-A-B
        if(t > R+P){
        	t = R + P;
        }
        
        // B-C-A
        if(t > Q+R){
        	t = Q + R;
        }
        
        System.out.println(t);
    }

} Main
import java.util.*;

public class Main{

	public static void main(String[] args){
    	Scanner scanner = new Scanner(System.in);
        
        int P = scanner.nextInt(); // A-B
        int Q = scanner.nextInt(); // B-C
        int R = scanner.nextInt(); // C-A
        
        // A-B-C
        int t = P + Q;
        
        // C-A-B
        if(t > R+P){
        	t = R + P;
        }
        
        // B-C-A
        if(t > Q+R){
        	t = Q + R;
        }
        
        System.out.println(t);
    }

}