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();

		int abc = p + q;
		int acb = r + q;
		int bac = p + r;

		int a = Math.min(abc, acb);
		int b = Math.min(a, bac);

		System.out.println(b);

		sc.close();

	}
} 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();

		int abc = p + q;
		int acb = r + q;
		int bac = p + r;

		int a = Math.min(abc, acb);
		int b = Math.min(a, bac);

		System.out.println(b);

		sc.close();

	}
} 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();

		int abc = p + q;
		int acb = r + q;
		int bac = p + r;

		int a = Math.min(abc, acb);
		int b = Math.min(a, bac);

		System.out.println(b);

		sc.close();

	} main {

		Scanner sc = new Scanner(System.in);

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

		int abc = p + q;
		int acb = r + q;
		int bac = p + r;

		int a = Math.min(abc, acb);
		int b = Math.min(a, bac);

		System.out.println(b);

		sc.close();

	} 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 int abc = p + q; abc p + q p q int acb = r + q; acb r + q r q int bac = p + r; bac p + r p r int a = Math.min(abc, acb); a Math.min(abc, acb) Math.min Math abc acb int b = Math.min(a, bac); b Math.min(a, bac) Math.min Math a bac System.out.println(b) System.out.println System.out System System.out b sc.close() sc.close sc 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();

		int abc = p + q;
		int acb = r + q;
		int bac = p + r;

		int a = Math.min(abc, acb);
		int b = Math.min(a, bac);

		System.out.println(b);

		sc.close();

	}
} 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();

		int abc = p + q;
		int acb = r + q;
		int bac = p + r;

		int a = Math.min(abc, acb);
		int b = Math.min(a, bac);

		System.out.println(b);

		sc.close();

	}
} 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();

		int abc = p + q;
		int acb = r + q;
		int bac = p + r;

		int a = Math.min(abc, acb);
		int b = Math.min(a, bac);

		System.out.println(b);

		sc.close();

	}
}