import java.util.*;

public class Main{
    public static void main(String[]args){
        Scanner entrada = new Scanner(System.in);
        int p = entrada.nextInt();
        int q = entrada.nextInt();
        int r = entrada.nextInt();
        int abc = p+q;
        int cab = r+p;
        int bca = q+r;
        if(abc<=cab && abc<=bca){
            System.out.println(abc);
        }else if(cab<=abc && cab<=bca){
            System.out.println(cab);
        }else if(bca <=abc && bca <=cab){
            System.out.println(bca);
        }
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[]args){
        Scanner entrada = new Scanner(System.in);
        int p = entrada.nextInt();
        int q = entrada.nextInt();
        int r = entrada.nextInt();
        int abc = p+q;
        int cab = r+p;
        int bca = q+r;
        if(abc<=cab && abc<=bca){
            System.out.println(abc);
        }else if(cab<=abc && cab<=bca){
            System.out.println(cab);
        }else if(bca <=abc && bca <=cab){
            System.out.println(bca);
        }
    }
} Main public static void main(String[]args){
        Scanner entrada = new Scanner(System.in);
        int p = entrada.nextInt();
        int q = entrada.nextInt();
        int r = entrada.nextInt();
        int abc = p+q;
        int cab = r+p;
        int bca = q+r;
        if(abc<=cab && abc<=bca){
            System.out.println(abc);
        }else if(cab<=abc && cab<=bca){
            System.out.println(cab);
        }else if(bca <=abc && bca <=cab){
            System.out.println(bca);
        }
    } main {
        Scanner entrada = new Scanner(System.in);
        int p = entrada.nextInt();
        int q = entrada.nextInt();
        int r = entrada.nextInt();
        int abc = p+q;
        int cab = r+p;
        int bca = q+r;
        if(abc<=cab && abc<=bca){
            System.out.println(abc);
        }else if(cab<=abc && cab<=bca){
            System.out.println(cab);
        }else if(bca <=abc && bca <=cab){
            System.out.println(bca);
        }
    } Scanner entrada = new Scanner(System.in); entrada new Scanner(System.in) int p = entrada.nextInt(); p entrada.nextInt() entrada.nextInt entrada int q = entrada.nextInt(); q entrada.nextInt() entrada.nextInt entrada int r = entrada.nextInt(); r entrada.nextInt() entrada.nextInt entrada int abc = p+q; abc p+q p q int cab = r+p; cab r+p r p int bca = q+r; bca q+r q r if(abc<=cab && abc<=bca){
            System.out.println(abc);
        }else if(cab<=abc && cab<=bca){
            System.out.println(cab);
        }else if(bca <=abc && bca <=cab){
            System.out.println(bca);
        } abc<=cab && abc<=bca abc<=cab abc cab abc<=bca abc bca {
            System.out.println(abc);
        } System.out.println(abc) System.out.println System.out System System.out abc if(cab<=abc && cab<=bca){
            System.out.println(cab);
        }else if(bca <=abc && bca <=cab){
            System.out.println(bca);
        } cab<=abc && cab<=bca cab<=abc cab abc cab<=bca cab bca {
            System.out.println(cab);
        } System.out.println(cab) System.out.println System.out System System.out cab if(bca <=abc && bca <=cab){
            System.out.println(bca);
        } bca <=abc && bca <=cab bca <=abc bca abc bca <=cab bca cab {
            System.out.println(bca);
        } System.out.println(bca) System.out.println System.out System System.out bca String[]args args public class Main{
    public static void main(String[]args){
        Scanner entrada = new Scanner(System.in);
        int p = entrada.nextInt();
        int q = entrada.nextInt();
        int r = entrada.nextInt();
        int abc = p+q;
        int cab = r+p;
        int bca = q+r;
        if(abc<=cab && abc<=bca){
            System.out.println(abc);
        }else if(cab<=abc && cab<=bca){
            System.out.println(cab);
        }else if(bca <=abc && bca <=cab){
            System.out.println(bca);
        }
    }
} public class Main{
    public static void main(String[]args){
        Scanner entrada = new Scanner(System.in);
        int p = entrada.nextInt();
        int q = entrada.nextInt();
        int r = entrada.nextInt();
        int abc = p+q;
        int cab = r+p;
        int bca = q+r;
        if(abc<=cab && abc<=bca){
            System.out.println(abc);
        }else if(cab<=abc && cab<=bca){
            System.out.println(cab);
        }else if(bca <=abc && bca <=cab){
            System.out.println(bca);
        }
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[]args){
        Scanner entrada = new Scanner(System.in);
        int p = entrada.nextInt();
        int q = entrada.nextInt();
        int r = entrada.nextInt();
        int abc = p+q;
        int cab = r+p;
        int bca = q+r;
        if(abc<=cab && abc<=bca){
            System.out.println(abc);
        }else if(cab<=abc && cab<=bca){
            System.out.println(cab);
        }else if(bca <=abc && bca <=cab){
            System.out.println(bca);
        }
    }
}