import 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 a = p+q;
			int b = r+q;
			int c = p+r;
			System.out.println(Math.min(a, Math.min(b, c)));
	}
} import java.util.*; util.* java 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 a = p+q;
			int b = r+q;
			int c = p+r;
			System.out.println(Math.min(a, Math.min(b, c)));
	}
} 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 a = p+q;
			int b = r+q;
			int c = p+r;
			System.out.println(Math.min(a, Math.min(b, c)));
	} main {
		Scanner sc = new Scanner(System.in);
			int p = sc.nextInt();
			int q = sc.nextInt();
			int r = sc.nextInt();
				
			int a = p+q;
			int b = r+q;
			int c = p+r;
			System.out.println(Math.min(a, Math.min(b, c)));
	} 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 a = p+q; a p+q p q int b = r+q; b r+q r q int c = p+r; c p+r p r System.out.println(Math.min(a, Math.min(b, c))) System.out.println System.out System System.out Math.min(a, Math.min(b, c)) Math.min Math a Math.min(b, c) Math.min Math b c 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 a = p+q;
			int b = r+q;
			int c = p+r;
			System.out.println(Math.min(a, Math.min(b, c)));
	}
} 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 a = p+q;
			int b = r+q;
			int c = p+r;
			System.out.println(Math.min(a, Math.min(b, c)));
	}
} Main
import 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 a = p+q;
			int b = r+q;
			int c = p+r;
			System.out.println(Math.min(a, Math.min(b, c)));
	}
}