import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int p = scan.nextInt();
      	int q = scan.nextInt();
      	int r = scan.nextInt();
      	int ab = p + q;
      	int bc = q + r;
      	int ca = r + p;
      	if(p + q <= q + r){
        	if(p + q <= r + p) {
            	System.out.print(p + q);
            }
          	else {
            	System.out.print(r + p);
            }
        }
      	else if(q + r < p + q){
        	if(q + r <= r + p){
            	System.out.print(q + r);
            }
          	else {
            	System.out.print(r + p);
            }
        }
    
    }
 
 
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int p = scan.nextInt();
      	int q = scan.nextInt();
      	int r = scan.nextInt();
      	int ab = p + q;
      	int bc = q + r;
      	int ca = r + p;
      	if(p + q <= q + r){
        	if(p + q <= r + p) {
            	System.out.print(p + q);
            }
          	else {
            	System.out.print(r + p);
            }
        }
      	else if(q + r < p + q){
        	if(q + r <= r + p){
            	System.out.print(q + r);
            }
          	else {
            	System.out.print(r + p);
            }
        }
    
    }
 
 
} Main public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int p = scan.nextInt();
      	int q = scan.nextInt();
      	int r = scan.nextInt();
      	int ab = p + q;
      	int bc = q + r;
      	int ca = r + p;
      	if(p + q <= q + r){
        	if(p + q <= r + p) {
            	System.out.print(p + q);
            }
          	else {
            	System.out.print(r + p);
            }
        }
      	else if(q + r < p + q){
        	if(q + r <= r + p){
            	System.out.print(q + r);
            }
          	else {
            	System.out.print(r + p);
            }
        }
    
    } main {
    	Scanner scan = new Scanner(System.in);
      	int p = scan.nextInt();
      	int q = scan.nextInt();
      	int r = scan.nextInt();
      	int ab = p + q;
      	int bc = q + r;
      	int ca = r + p;
      	if(p + q <= q + r){
        	if(p + q <= r + p) {
            	System.out.print(p + q);
            }
          	else {
            	System.out.print(r + p);
            }
        }
      	else if(q + r < p + q){
        	if(q + r <= r + p){
            	System.out.print(q + r);
            }
          	else {
            	System.out.print(r + p);
            }
        }
    
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int p = scan.nextInt(); p scan.nextInt() scan.nextInt scan int q = scan.nextInt(); q scan.nextInt() scan.nextInt scan int r = scan.nextInt(); r scan.nextInt() scan.nextInt scan int ab = p + q; ab p + q p q int bc = q + r; bc q + r q r int ca = r + p; ca r + p r p if(p + q <= q + r){
        	if(p + q <= r + p) {
            	System.out.print(p + q);
            }
          	else {
            	System.out.print(r + p);
            }
        }
      	else if(q + r < p + q){
        	if(q + r <= r + p){
            	System.out.print(q + r);
            }
          	else {
            	System.out.print(r + p);
            }
        } p + q <= q + r p + q p q q + r q r {
        	if(p + q <= r + p) {
            	System.out.print(p + q);
            }
          	else {
            	System.out.print(r + p);
            }
        } if(p + q <= r + p) {
            	System.out.print(p + q);
            }
          	else {
            	System.out.print(r + p);
            } p + q <= r + p p + q p q r + p r p {
            	System.out.print(p + q);
            } System.out.print(p + q) System.out.print System.out System System.out p + q p q {
            	System.out.print(r + p);
            } System.out.print(r + p) System.out.print System.out System System.out r + p r p if(q + r < p + q){
        	if(q + r <= r + p){
            	System.out.print(q + r);
            }
          	else {
            	System.out.print(r + p);
            }
        } q + r < p + q q + r q r p + q p q {
        	if(q + r <= r + p){
            	System.out.print(q + r);
            }
          	else {
            	System.out.print(r + p);
            }
        } if(q + r <= r + p){
            	System.out.print(q + r);
            }
          	else {
            	System.out.print(r + p);
            } q + r <= r + p q + r q r r + p r p {
            	System.out.print(q + r);
            } System.out.print(q + r) System.out.print System.out System System.out q + r q r {
            	System.out.print(r + p);
            } System.out.print(r + p) System.out.print System.out System System.out r + p r p String[] args args public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int p = scan.nextInt();
      	int q = scan.nextInt();
      	int r = scan.nextInt();
      	int ab = p + q;
      	int bc = q + r;
      	int ca = r + p;
      	if(p + q <= q + r){
        	if(p + q <= r + p) {
            	System.out.print(p + q);
            }
          	else {
            	System.out.print(r + p);
            }
        }
      	else if(q + r < p + q){
        	if(q + r <= r + p){
            	System.out.print(q + r);
            }
          	else {
            	System.out.print(r + p);
            }
        }
    
    }
 
 
} public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int p = scan.nextInt();
      	int q = scan.nextInt();
      	int r = scan.nextInt();
      	int ab = p + q;
      	int bc = q + r;
      	int ca = r + p;
      	if(p + q <= q + r){
        	if(p + q <= r + p) {
            	System.out.print(p + q);
            }
          	else {
            	System.out.print(r + p);
            }
        }
      	else if(q + r < p + q){
        	if(q + r <= r + p){
            	System.out.print(q + r);
            }
          	else {
            	System.out.print(r + p);
            }
        }
    
    }
 
 
} Main
import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int p = scan.nextInt();
      	int q = scan.nextInt();
      	int r = scan.nextInt();
      	int ab = p + q;
      	int bc = q + r;
      	int ca = r + p;
      	if(p + q <= q + r){
        	if(p + q <= r + p) {
            	System.out.print(p + q);
            }
          	else {
            	System.out.print(r + p);
            }
        }
      	else if(q + r < p + q){
        	if(q + r <= r + p){
            	System.out.print(q + r);
            }
          	else {
            	System.out.print(r + p);
            }
        }
    
    }
 
 
}