

import java.util.Scanner;

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 sum=P+Q;
		if(sum>Q+R) {
			sum=Q+R;
			if(sum>P+R) sum=P+R;
		}
		
		if(sum>P+R){
			sum=P+R;
			if(sum>Q+R) sum=Q+R;
		}
		
		System.out.print(sum);
		
	}

} import java.util.Scanner; Scanner 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 sum=P+Q;
		if(sum>Q+R) {
			sum=Q+R;
			if(sum>P+R) sum=P+R;
		}
		
		if(sum>P+R){
			sum=P+R;
			if(sum>Q+R) sum=Q+R;
		}
		
		System.out.print(sum);
		
	}

} 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 sum=P+Q;
		if(sum>Q+R) {
			sum=Q+R;
			if(sum>P+R) sum=P+R;
		}
		
		if(sum>P+R){
			sum=P+R;
			if(sum>Q+R) sum=Q+R;
		}
		
		System.out.print(sum);
		
	} main {
		Scanner sc = new Scanner(System.in);
		int P = sc.nextInt();
		int Q = sc.nextInt();
		int R = sc.nextInt();
		
		int sum=P+Q;
		if(sum>Q+R) {
			sum=Q+R;
			if(sum>P+R) sum=P+R;
		}
		
		if(sum>P+R){
			sum=P+R;
			if(sum>Q+R) sum=Q+R;
		}
		
		System.out.print(sum);
		
	} 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 sum=P+Q; sum P+Q P Q if(sum>Q+R) {
			sum=Q+R;
			if(sum>P+R) sum=P+R;
		} sum>Q+R sum Q+R Q R {
			sum=Q+R;
			if(sum>P+R) sum=P+R;
		} sum=Q+R sum Q+R Q R if(sum>P+R) sum=P+R; sum>P+R sum P+R P R sum=P+R sum P+R P R if(sum>P+R){
			sum=P+R;
			if(sum>Q+R) sum=Q+R;
		} sum>P+R sum P+R P R {
			sum=P+R;
			if(sum>Q+R) sum=Q+R;
		} sum=P+R sum P+R P R if(sum>Q+R) sum=Q+R; sum>Q+R sum Q+R Q R sum=Q+R sum Q+R Q R System.out.print(sum) System.out.print System.out System System.out sum 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 sum=P+Q;
		if(sum>Q+R) {
			sum=Q+R;
			if(sum>P+R) sum=P+R;
		}
		
		if(sum>P+R){
			sum=P+R;
			if(sum>Q+R) sum=Q+R;
		}
		
		System.out.print(sum);
		
	}

} 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 sum=P+Q;
		if(sum>Q+R) {
			sum=Q+R;
			if(sum>P+R) sum=P+R;
		}
		
		if(sum>P+R){
			sum=P+R;
			if(sum>Q+R) sum=Q+R;
		}
		
		System.out.print(sum);
		
	}

} Main


import java.util.Scanner;

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 sum=P+Q;
		if(sum>Q+R) {
			sum=Q+R;
			if(sum>P+R) sum=P+R;
		}
		
		if(sum>P+R){
			sum=P+R;
			if(sum>Q+R) sum=Q+R;
		}
		
		System.out.print(sum);
		
	}

}
