import java.util.Scanner;

public class Main {

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

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

		int max = 0;
		if ( p >= q && p >= r ) max = p;
		if ( q >= p && q >= r ) max = q;
		if ( r >= q && r >= p ) max = r;

		System.out.println(p + q + r - max);
		in.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

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

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

		int max = 0;
		if ( p >= q && p >= r ) max = p;
		if ( q >= p && q >= r ) max = q;
		if ( r >= q && r >= p ) max = r;

		System.out.println(p + q + r - max);
		in.close();
	}
} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

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

		int max = 0;
		if ( p >= q && p >= r ) max = p;
		if ( q >= p && q >= r ) max = q;
		if ( r >= q && r >= p ) max = r;

		System.out.println(p + q + r - max);
		in.close();
	} main {
		Scanner in = new Scanner(System.in);

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

		int max = 0;
		if ( p >= q && p >= r ) max = p;
		if ( q >= p && q >= r ) max = q;
		if ( r >= q && r >= p ) max = r;

		System.out.println(p + q + r - max);
		in.close();
	} Scanner in = new Scanner(System.in); in new Scanner(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 int max = 0; max 0 if ( p >= q && p >= r ) max = p; p >= q && p >= r p >= q p q p >= r p r max = p max p if ( q >= p && q >= r ) max = q; q >= p && q >= r q >= p q p q >= r q r max = q max q if ( r >= q && r >= p ) max = r; r >= q && r >= p r >= q r q r >= p r p max = r max r System.out.println(p + q + r - max) System.out.println System.out System System.out p + q + r - max p + q + r p + q + r p q r max in.close() in.close in String[] args args public class Main {

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

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

		int max = 0;
		if ( p >= q && p >= r ) max = p;
		if ( q >= p && q >= r ) max = q;
		if ( r >= q && r >= p ) max = r;

		System.out.println(p + q + r - max);
		in.close();
	}
} public class Main {

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

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

		int max = 0;
		if ( p >= q && p >= r ) max = p;
		if ( q >= p && q >= r ) max = q;
		if ( r >= q && r >= p ) max = r;

		System.out.println(p + q + r - max);
		in.close();
	}
} Main
import java.util.Scanner;

public class Main {

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

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

		int max = 0;
		if ( p >= q && p >= r ) max = p;
		if ( q >= p && q >= r ) max = q;
		if ( r >= q && r >= p ) max = r;

		System.out.println(p + q + r - max);
		in.close();
	}
}