import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int P = stdIn.nextInt();
		int Q = stdIn.nextInt();
		int R = stdIn.nextInt();
		
		if(P <= Q) {
			if(R <= Q) {
				System.out.println(P+R);
			}
			else {
				System.out.println(P+Q);
			}
			
		}
		else {
			if(R <= P) {
				System.out.println(R+Q);
			}
			else {
				System.out.println(P+Q);
			}
		}

	}

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

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int P = stdIn.nextInt();
		int Q = stdIn.nextInt();
		int R = stdIn.nextInt();
		
		if(P <= Q) {
			if(R <= Q) {
				System.out.println(P+R);
			}
			else {
				System.out.println(P+Q);
			}
			
		}
		else {
			if(R <= P) {
				System.out.println(R+Q);
			}
			else {
				System.out.println(P+Q);
			}
		}

	}

} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int P = stdIn.nextInt();
		int Q = stdIn.nextInt();
		int R = stdIn.nextInt();
		
		if(P <= Q) {
			if(R <= Q) {
				System.out.println(P+R);
			}
			else {
				System.out.println(P+Q);
			}
			
		}
		else {
			if(R <= P) {
				System.out.println(R+Q);
			}
			else {
				System.out.println(P+Q);
			}
		}

	} main {
		Scanner stdIn = new Scanner(System.in);
		int P = stdIn.nextInt();
		int Q = stdIn.nextInt();
		int R = stdIn.nextInt();
		
		if(P <= Q) {
			if(R <= Q) {
				System.out.println(P+R);
			}
			else {
				System.out.println(P+Q);
			}
			
		}
		else {
			if(R <= P) {
				System.out.println(R+Q);
			}
			else {
				System.out.println(P+Q);
			}
		}

	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int P = stdIn.nextInt(); P stdIn.nextInt() stdIn.nextInt stdIn int Q = stdIn.nextInt(); Q stdIn.nextInt() stdIn.nextInt stdIn int R = stdIn.nextInt(); R stdIn.nextInt() stdIn.nextInt stdIn if(P <= Q) {
			if(R <= Q) {
				System.out.println(P+R);
			}
			else {
				System.out.println(P+Q);
			}
			
		}
		else {
			if(R <= P) {
				System.out.println(R+Q);
			}
			else {
				System.out.println(P+Q);
			}
		} P <= Q P Q {
			if(R <= Q) {
				System.out.println(P+R);
			}
			else {
				System.out.println(P+Q);
			}
			
		} if(R <= Q) {
				System.out.println(P+R);
			}
			else {
				System.out.println(P+Q);
			} R <= Q R Q {
				System.out.println(P+R);
			} System.out.println(P+R) System.out.println System.out System System.out 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 {
			if(R <= P) {
				System.out.println(R+Q);
			}
			else {
				System.out.println(P+Q);
			}
		} if(R <= P) {
				System.out.println(R+Q);
			}
			else {
				System.out.println(P+Q);
			} R <= P R P {
				System.out.println(R+Q);
			} System.out.println(R+Q) System.out.println System.out System System.out R+Q R Q {
				System.out.println(P+Q);
			} System.out.println(P+Q) System.out.println System.out System System.out P+Q P Q String[] args args public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int P = stdIn.nextInt();
		int Q = stdIn.nextInt();
		int R = stdIn.nextInt();
		
		if(P <= Q) {
			if(R <= Q) {
				System.out.println(P+R);
			}
			else {
				System.out.println(P+Q);
			}
			
		}
		else {
			if(R <= P) {
				System.out.println(R+Q);
			}
			else {
				System.out.println(P+Q);
			}
		}

	}

} public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int P = stdIn.nextInt();
		int Q = stdIn.nextInt();
		int R = stdIn.nextInt();
		
		if(P <= Q) {
			if(R <= Q) {
				System.out.println(P+R);
			}
			else {
				System.out.println(P+Q);
			}
			
		}
		else {
			if(R <= P) {
				System.out.println(R+Q);
			}
			else {
				System.out.println(P+Q);
			}
		}

	}

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

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int P = stdIn.nextInt();
		int Q = stdIn.nextInt();
		int R = stdIn.nextInt();
		
		if(P <= Q) {
			if(R <= Q) {
				System.out.println(P+R);
			}
			else {
				System.out.println(P+Q);
			}
			
		}
		else {
			if(R <= P) {
				System.out.println(R+Q);
			}
			else {
				System.out.println(P+Q);
			}
		}

	}

}