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 min=p+q;
		if(min>q+r)
			min=q+r;
		if(min>p+r)
			min=p+r;
		System.out.println(min);
	}
		
} 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 min=p+q;
		if(min>q+r)
			min=q+r;
		if(min>p+r)
			min=p+r;
		System.out.println(min);
	}
		
} 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 min=p+q;
		if(min>q+r)
			min=q+r;
		if(min>p+r)
			min=p+r;
		System.out.println(min);
	} main {
		Scanner sc=new Scanner(System.in);
		int p=sc.nextInt();
		int q=sc.nextInt();
		int r=sc.nextInt();
		int min=p+q;
		if(min>q+r)
			min=q+r;
		if(min>p+r)
			min=p+r;
		System.out.println(min);
	} 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 min=p+q; min p+q p q if(min>q+r)
			min=q+r; min>q+r min q+r q r min=q+r min q+r q r if(min>p+r)
			min=p+r; min>p+r min p+r p r min=p+r min p+r p r System.out.println(min) System.out.println System.out System System.out min 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 min=p+q;
		if(min>q+r)
			min=q+r;
		if(min>p+r)
			min=p+r;
		System.out.println(min);
	}
		
}