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();
		sc.close();

		int a = p + q;
		int b = q + r;
		int c = r + p;

		if (a > b) {
			if (b > c) {
				System.out.println(c);
			} else {
				System.out.println(b);
			}
		} else if (a > c) {
			System.out.println(c);
		} else {
			System.out.println(a);
		}
	}
} 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();
		sc.close();

		int a = p + q;
		int b = q + r;
		int c = r + p;

		if (a > b) {
			if (b > c) {
				System.out.println(c);
			} else {
				System.out.println(b);
			}
		} else if (a > c) {
			System.out.println(c);
		} else {
			System.out.println(a);
		}
	}
} 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();
		sc.close();

		int a = p + q;
		int b = q + r;
		int c = r + p;

		if (a > b) {
			if (b > c) {
				System.out.println(c);
			} else {
				System.out.println(b);
			}
		} else if (a > c) {
			System.out.println(c);
		} else {
			System.out.println(a);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int p = sc.nextInt();
		int q = sc.nextInt();
		int r = sc.nextInt();
		sc.close();

		int a = p + q;
		int b = q + r;
		int c = r + p;

		if (a > b) {
			if (b > c) {
				System.out.println(c);
			} else {
				System.out.println(b);
			}
		} else if (a > c) {
			System.out.println(c);
		} else {
			System.out.println(a);
		}
	} 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 sc.close() sc.close sc int a = p + q; a p + q p q int b = q + r; b q + r q r int c = r + p; c r + p r p if (a > b) {
			if (b > c) {
				System.out.println(c);
			} else {
				System.out.println(b);
			}
		} else if (a > c) {
			System.out.println(c);
		} else {
			System.out.println(a);
		} a > b a b {
			if (b > c) {
				System.out.println(c);
			} else {
				System.out.println(b);
			}
		} if (b > c) {
				System.out.println(c);
			} else {
				System.out.println(b);
			} b > c b c {
				System.out.println(c);
			} System.out.println(c) System.out.println System.out System System.out c {
				System.out.println(b);
			} System.out.println(b) System.out.println System.out System System.out b if (a > c) {
			System.out.println(c);
		} else {
			System.out.println(a);
		} a > c a c {
			System.out.println(c);
		} System.out.println(c) System.out.println System.out System System.out c {
			System.out.println(a);
		} System.out.println(a) System.out.println System.out System System.out a 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();
		sc.close();

		int a = p + q;
		int b = q + r;
		int c = r + p;

		if (a > b) {
			if (b > c) {
				System.out.println(c);
			} else {
				System.out.println(b);
			}
		} else if (a > c) {
			System.out.println(c);
		} else {
			System.out.println(a);
		}
	}
} 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();
		sc.close();

		int a = p + q;
		int b = q + r;
		int c = r + p;

		if (a > b) {
			if (b > c) {
				System.out.println(c);
			} else {
				System.out.println(b);
			}
		} else if (a > c) {
			System.out.println(c);
		} else {
			System.out.println(a);
		}
	}
} 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();
		sc.close();

		int a = p + q;
		int b = q + r;
		int c = r + p;

		if (a > b) {
			if (b > c) {
				System.out.println(c);
			} else {
				System.out.println(b);
			}
		} else if (a > c) {
			System.out.println(c);
		} else {
			System.out.println(a);
		}
	}
}
