import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		int p = sc.nextInt();
		int q = sc.nextInt();
		int r = sc.nextInt();
		int result;

		if(p<=q) {
			result = p;
			if(r<=q){
				result += r;
			}else {
				result += q;
			}
		}else {
			result = q;
			if(r<=p) {
				result += r;
			}else {
				result += p;
			}
		}

		System.out.println(result);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		int p = sc.nextInt();
		int q = sc.nextInt();
		int r = sc.nextInt();
		int result;

		if(p<=q) {
			result = p;
			if(r<=q){
				result += r;
			}else {
				result += q;
			}
		}else {
			result = q;
			if(r<=p) {
				result += r;
			}else {
				result += p;
			}
		}

		System.out.println(result);
	}

} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {

		int p = sc.nextInt();
		int q = sc.nextInt();
		int r = sc.nextInt();
		int result;

		if(p<=q) {
			result = p;
			if(r<=q){
				result += r;
			}else {
				result += q;
			}
		}else {
			result = q;
			if(r<=p) {
				result += r;
			}else {
				result += p;
			}
		}

		System.out.println(result);
	} main {

		int p = sc.nextInt();
		int q = sc.nextInt();
		int r = sc.nextInt();
		int result;

		if(p<=q) {
			result = p;
			if(r<=q){
				result += r;
			}else {
				result += q;
			}
		}else {
			result = q;
			if(r<=p) {
				result += r;
			}else {
				result += p;
			}
		}

		System.out.println(result);
	} 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 result; result if(p<=q) {
			result = p;
			if(r<=q){
				result += r;
			}else {
				result += q;
			}
		}else {
			result = q;
			if(r<=p) {
				result += r;
			}else {
				result += p;
			}
		} p<=q p q {
			result = p;
			if(r<=q){
				result += r;
			}else {
				result += q;
			}
		} result = p result p if(r<=q){
				result += r;
			}else {
				result += q;
			} r<=q r q {
				result += r;
			} result += r result r {
				result += q;
			} result += q result q {
			result = q;
			if(r<=p) {
				result += r;
			}else {
				result += p;
			}
		} result = q result q if(r<=p) {
				result += r;
			}else {
				result += p;
			} r<=p r p {
				result += r;
			} result += r result r {
				result += p;
			} result += p result p System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		int p = sc.nextInt();
		int q = sc.nextInt();
		int r = sc.nextInt();
		int result;

		if(p<=q) {
			result = p;
			if(r<=q){
				result += r;
			}else {
				result += q;
			}
		}else {
			result = q;
			if(r<=p) {
				result += r;
			}else {
				result += p;
			}
		}

		System.out.println(result);
	}

} public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		int p = sc.nextInt();
		int q = sc.nextInt();
		int r = sc.nextInt();
		int result;

		if(p<=q) {
			result = p;
			if(r<=q){
				result += r;
			}else {
				result += q;
			}
		}else {
			result = q;
			if(r<=p) {
				result += r;
			}else {
				result += p;
			}
		}

		System.out.println(result);
	}

} Main
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		int p = sc.nextInt();
		int q = sc.nextInt();
		int r = sc.nextInt();
		int result;

		if(p<=q) {
			result = p;
			if(r<=q){
				result += r;
			}else {
				result += q;
			}
		}else {
			result = q;
			if(r<=p) {
				result += r;
			}else {
				result += p;
			}
		}

		System.out.println(result);
	}

}
