import java.util.*;
 
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 time[] = new int[3];
		time[0] = p + q;
		time[1] = r + q;
		time[2] = p + r;
 
		Arrays.sort(time);

		System.out.println(time[0]);
	}
} import java.util.*; util.* java 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 time[] = new int[3];
		time[0] = p + q;
		time[1] = r + q;
		time[2] = p + r;
 
		Arrays.sort(time);

		System.out.println(time[0]);
	}
} 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 time[] = new int[3];
		time[0] = p + q;
		time[1] = r + q;
		time[2] = p + r;
 
		Arrays.sort(time);

		System.out.println(time[0]);
	} main {
 
		Scanner sc = new Scanner(System.in);
		int p = sc.nextInt();
		int q = sc.nextInt();
		int r = sc.nextInt();
 
		int time[] = new int[3];
		time[0] = p + q;
		time[1] = r + q;
		time[2] = p + r;
 
		Arrays.sort(time);

		System.out.println(time[0]);
	} 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 time[] = new int[3]; time new int[3] 3 time[0] = p + q time[0] time 0 p + q p q time[1] = r + q time[1] time 1 r + q r q time[2] = p + r time[2] time 2 p + r p r Arrays.sort(time) Arrays.sort Arrays time System.out.println(time[0]) System.out.println System.out System System.out time[0] time 0 String[] args args
import java.util.*;
 
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 time[] = new int[3];
		time[0] = p + q;
		time[1] = r + q;
		time[2] = p + r;
 
		Arrays.sort(time);

		System.out.println(time[0]);
	}
}