import 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 ans = 0;

		if(p>=q&&p>=r)ans = q+r;
		if(q>=p&&q>=r)ans = p+r;
		if(r>=p&&r>=q)ans = p+q;

		// 出力
		System.out.println(ans);
	}
} import java.util.*; util.* java 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 ans = 0;

		if(p>=q&&p>=r)ans = q+r;
		if(q>=p&&q>=r)ans = p+r;
		if(r>=p&&r>=q)ans = p+q;

		// 出力
		System.out.println(ans);
	}
} 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 ans = 0;

		if(p>=q&&p>=r)ans = q+r;
		if(q>=p&&q>=r)ans = p+r;
		if(r>=p&&r>=q)ans = p+q;

		// 出力
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int p = sc.nextInt();
		int q = sc.nextInt();
		int r = sc.nextInt();

		int ans = 0;

		if(p>=q&&p>=r)ans = q+r;
		if(q>=p&&q>=r)ans = p+r;
		if(r>=p&&r>=q)ans = p+q;

		// 出力
		System.out.println(ans);
	} 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 ans = 0; ans 0 if(p>=q&&p>=r)ans = q+r; p>=q&&p>=r p>=q p q p>=r p r ans = q+r ans q+r q r if(q>=p&&q>=r)ans = p+r; q>=p&&q>=r q>=p q p q>=r q r ans = p+r ans p+r p r if(r>=p&&r>=q)ans = p+q; r>=p&&r>=q r>=p r p r>=q r q ans = p+q ans p+q p q System.out.println(ans) System.out.println System.out System System.out ans 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 ans = 0;

		if(p>=q&&p>=r)ans = q+r;
		if(q>=p&&q>=r)ans = p+r;
		if(r>=p&&r>=q)ans = p+q;

		// 出力
		System.out.println(ans);
	}
} 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 ans = 0;

		if(p>=q&&p>=r)ans = q+r;
		if(q>=p&&q>=r)ans = p+r;
		if(r>=p&&r>=q)ans = p+q;

		// 出力
		System.out.println(ans);
	}
} Main
import 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 ans = 0;

		if(p>=q&&p>=r)ans = q+r;
		if(q>=p&&q>=r)ans = p+r;
		if(r>=p&&r>=q)ans = p+q;

		// 出力
		System.out.println(ans);
	}
}