import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

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

	private static int solve(int p, int q, int r) {
		int a = p + q;
		if (a > q + r)
			a = q + r;
		if (a > r + p)
			a = r + p;
		return a;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int p = in.nextInt();
		int q = in.nextInt();
		int r = in.nextInt();
		System.out.println(solve(p, q, r));
		in.close();
	}

	private static int solve(int p, int q, int r) {
		int a = p + q;
		if (a > q + r)
			a = q + r;
		if (a > r + p)
			a = r + p;
		return a;
	}
} Main public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int p = in.nextInt();
		int q = in.nextInt();
		int r = in.nextInt();
		System.out.println(solve(p, q, r));
		in.close();
	} main {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int p = in.nextInt();
		int q = in.nextInt();
		int r = in.nextInt();
		System.out.println(solve(p, q, r));
		in.close();
	} Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); in new Scanner(new BufferedReader(new InputStreamReader(System.in))) int p = in.nextInt(); p in.nextInt() in.nextInt in int q = in.nextInt(); q in.nextInt() in.nextInt in int r = in.nextInt(); r in.nextInt() in.nextInt in System.out.println(solve(p, q, r)) System.out.println System.out System System.out solve(p, q, r) solve p q r in.close() in.close in String[] args args private static int solve(int p, int q, int r) {
		int a = p + q;
		if (a > q + r)
			a = q + r;
		if (a > r + p)
			a = r + p;
		return a;
	} solve {
		int a = p + q;
		if (a > q + r)
			a = q + r;
		if (a > r + p)
			a = r + p;
		return a;
	} int a = p + q; a p + q p q if (a > q + r)
			a = q + r; a > q + r a q + r q r a = q + r a q + r q r if (a > r + p)
			a = r + p; a > r + p a r + p r p a = r + p a r + p r p return a; a int p p int q q int r r public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int p = in.nextInt();
		int q = in.nextInt();
		int r = in.nextInt();
		System.out.println(solve(p, q, r));
		in.close();
	}

	private static int solve(int p, int q, int r) {
		int a = p + q;
		if (a > q + r)
			a = q + r;
		if (a > r + p)
			a = r + p;
		return a;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int p = in.nextInt();
		int q = in.nextInt();
		int r = in.nextInt();
		System.out.println(solve(p, q, r));
		in.close();
	}

	private static int solve(int p, int q, int r) {
		int a = p + q;
		if (a > q + r)
			a = q + r;
		if (a > r + p)
			a = r + p;
		return a;
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

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

	private static int solve(int p, int q, int r) {
		int a = p + q;
		if (a > q + r)
			a = q + r;
		if (a > r + p)
			a = r + p;
		return a;
	}
}