import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int p = s.nextInt();
		int q = s.nextInt();
		int r = s.nextInt();
		System.out.println(Main.calc(p, q, r));
	}

	public static int calc(int p, int q, int r) {

		Integer array[]= {p,q,r};
		Arrays.sort(array);
		return array[0]+array[1];
	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int p = s.nextInt();
		int q = s.nextInt();
		int r = s.nextInt();
		System.out.println(Main.calc(p, q, r));
	}

	public static int calc(int p, int q, int r) {

		Integer array[]= {p,q,r};
		Arrays.sort(array);
		return array[0]+array[1];
	}

} Main public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int p = s.nextInt();
		int q = s.nextInt();
		int r = s.nextInt();
		System.out.println(Main.calc(p, q, r));
	} main {
		Scanner s = new Scanner(System.in);
		int p = s.nextInt();
		int q = s.nextInt();
		int r = s.nextInt();
		System.out.println(Main.calc(p, q, r));
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int p = s.nextInt(); p s.nextInt() s.nextInt s int q = s.nextInt(); q s.nextInt() s.nextInt s int r = s.nextInt(); r s.nextInt() s.nextInt s System.out.println(Main.calc(p, q, r)) System.out.println System.out System System.out Main.calc(p, q, r) Main.calc Main p q r String[] args args public static int calc(int p, int q, int r) {

		Integer array[]= {p,q,r};
		Arrays.sort(array);
		return array[0]+array[1];
	} calc {

		Integer array[]= {p,q,r};
		Arrays.sort(array);
		return array[0]+array[1];
	} Integer array[]= {p,q,r}; array {p,q,r} p q r Arrays.sort(array) Arrays.sort Arrays array return array[0]+array[1]; array[0]+array[1] array[0] array 0 array[1] array 1 int p p int q q int r r public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int p = s.nextInt();
		int q = s.nextInt();
		int r = s.nextInt();
		System.out.println(Main.calc(p, q, r));
	}

	public static int calc(int p, int q, int r) {

		Integer array[]= {p,q,r};
		Arrays.sort(array);
		return array[0]+array[1];
	}

} public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int p = s.nextInt();
		int q = s.nextInt();
		int r = s.nextInt();
		System.out.println(Main.calc(p, q, r));
	}

	public static int calc(int p, int q, int r) {

		Integer array[]= {p,q,r};
		Arrays.sort(array);
		return array[0]+array[1];
	}

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int p = s.nextInt();
		int q = s.nextInt();
		int r = s.nextInt();
		System.out.println(Main.calc(p, q, r));
	}

	public static int calc(int p, int q, int r) {

		Integer array[]= {p,q,r};
		Arrays.sort(array);
		return array[0]+array[1];
	}

}