import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int p = scan.nextInt();
		int q = scan.nextInt();
		int r = scan.nextInt();

		if(p<=q) {
			if(q<=r) System.out.println(p+q);
			else System.out.println(p+r);
		}
		else {
			if(p<=r) System.out.println(p+q);
			else System.out.println(q+r);
		}


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

		if(p<=q) {
			if(q<=r) System.out.println(p+q);
			else System.out.println(p+r);
		}
		else {
			if(p<=r) System.out.println(p+q);
			else System.out.println(q+r);
		}


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

		if(p<=q) {
			if(q<=r) System.out.println(p+q);
			else System.out.println(p+r);
		}
		else {
			if(p<=r) System.out.println(p+q);
			else System.out.println(q+r);
		}


	} main {
		Scanner scan = new Scanner(System.in);
		int p = scan.nextInt();
		int q = scan.nextInt();
		int r = scan.nextInt();

		if(p<=q) {
			if(q<=r) System.out.println(p+q);
			else System.out.println(p+r);
		}
		else {
			if(p<=r) System.out.println(p+q);
			else System.out.println(q+r);
		}


	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int p = scan.nextInt(); p scan.nextInt() scan.nextInt scan int q = scan.nextInt(); q scan.nextInt() scan.nextInt scan int r = scan.nextInt(); r scan.nextInt() scan.nextInt scan if(p<=q) {
			if(q<=r) System.out.println(p+q);
			else System.out.println(p+r);
		}
		else {
			if(p<=r) System.out.println(p+q);
			else System.out.println(q+r);
		} p<=q p q {
			if(q<=r) System.out.println(p+q);
			else System.out.println(p+r);
		} if(q<=r) System.out.println(p+q);
			else System.out.println(p+r); q<=r q r System.out.println(p+q) System.out.println System.out System System.out p+q p q System.out.println(p+r) System.out.println System.out System System.out p+r p r {
			if(p<=r) System.out.println(p+q);
			else System.out.println(q+r);
		} if(p<=r) System.out.println(p+q);
			else System.out.println(q+r); p<=r p r System.out.println(p+q) System.out.println System.out System System.out p+q p q System.out.println(q+r) System.out.println System.out System System.out q+r q r String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int p = scan.nextInt();
		int q = scan.nextInt();
		int r = scan.nextInt();

		if(p<=q) {
			if(q<=r) System.out.println(p+q);
			else System.out.println(p+r);
		}
		else {
			if(p<=r) System.out.println(p+q);
			else System.out.println(q+r);
		}


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

		if(p<=q) {
			if(q<=r) System.out.println(p+q);
			else System.out.println(p+r);
		}
		else {
			if(p<=r) System.out.println(p+q);
			else System.out.println(q+r);
		}


	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int p = scan.nextInt();
		int q = scan.nextInt();
		int r = scan.nextInt();

		if(p<=q) {
			if(q<=r) System.out.println(p+q);
			else System.out.println(p+r);
		}
		else {
			if(p<=r) System.out.println(p+q);
			else System.out.println(q+r);
		}


	}
}