import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] Args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int p, q, r;
        p = Integer.parseInt(st.nextToken());
        q = Integer.parseInt(st.nextToken());
        r = Integer.parseInt(st.nextToken());
        if(p + q <= r + q && p + q <= p + r){
            System.out.println(p + q);
        }
        else if(p + r <= p + q && p + r <= r + q){
            System.out.println(p + r);
        }
        else if(r + q <= p + q && r + q <= p + r){
            System.out.println(r + q);
        }

        br.close();
    }
} import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.BufferedReader; BufferedReader java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main {

    public static void main(String[] Args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int p, q, r;
        p = Integer.parseInt(st.nextToken());
        q = Integer.parseInt(st.nextToken());
        r = Integer.parseInt(st.nextToken());
        if(p + q <= r + q && p + q <= p + r){
            System.out.println(p + q);
        }
        else if(p + r <= p + q && p + r <= r + q){
            System.out.println(p + r);
        }
        else if(r + q <= p + q && r + q <= p + r){
            System.out.println(r + q);
        }

        br.close();
    }
} Main public static void main(String[] Args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int p, q, r;
        p = Integer.parseInt(st.nextToken());
        q = Integer.parseInt(st.nextToken());
        r = Integer.parseInt(st.nextToken());
        if(p + q <= r + q && p + q <= p + r){
            System.out.println(p + q);
        }
        else if(p + r <= p + q && p + r <= r + q){
            System.out.println(p + r);
        }
        else if(r + q <= p + q && r + q <= p + r){
            System.out.println(r + q);
        }

        br.close();
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int p, q, r;
        p = Integer.parseInt(st.nextToken());
        q = Integer.parseInt(st.nextToken());
        r = Integer.parseInt(st.nextToken());
        if(p + q <= r + q && p + q <= p + r){
            System.out.println(p + q);
        }
        else if(p + r <= p + q && p + r <= r + q){
            System.out.println(p + r);
        }
        else if(r + q <= p + q && r + q <= p + r){
            System.out.println(r + q);
        }

        br.close();
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer st = new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) int p p q q r; r p = Integer.parseInt(st.nextToken()) p Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st q = Integer.parseInt(st.nextToken()) q Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st r = Integer.parseInt(st.nextToken()) r Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st if(p + q <= r + q && p + q <= p + r){
            System.out.println(p + q);
        }
        else if(p + r <= p + q && p + r <= r + q){
            System.out.println(p + r);
        }
        else if(r + q <= p + q && r + q <= p + r){
            System.out.println(r + q);
        } p + q <= r + q && p + q <= p + r p + q <= r + q p + q p q r + q r q p + q <= p + r p + q p q p + r p r {
            System.out.println(p + q);
        } System.out.println(p + q) System.out.println System.out System System.out p + q p q if(p + r <= p + q && p + r <= r + q){
            System.out.println(p + r);
        }
        else if(r + q <= p + q && r + q <= p + r){
            System.out.println(r + q);
        } p + r <= p + q && p + r <= r + q p + r <= p + q p + r p r p + q p q p + r <= r + q p + r p r r + q r q {
            System.out.println(p + r);
        } System.out.println(p + r) System.out.println System.out System System.out p + r p r if(r + q <= p + q && r + q <= p + r){
            System.out.println(r + q);
        } r + q <= p + q && r + q <= p + r r + q <= p + q r + q r q p + q p q r + q <= p + r r + q r q p + r p r {
            System.out.println(r + q);
        } System.out.println(r + q) System.out.println System.out System System.out r + q r q br.close() br.close br String[] Args Args public class Main {

    public static void main(String[] Args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int p, q, r;
        p = Integer.parseInt(st.nextToken());
        q = Integer.parseInt(st.nextToken());
        r = Integer.parseInt(st.nextToken());
        if(p + q <= r + q && p + q <= p + r){
            System.out.println(p + q);
        }
        else if(p + r <= p + q && p + r <= r + q){
            System.out.println(p + r);
        }
        else if(r + q <= p + q && r + q <= p + r){
            System.out.println(r + q);
        }

        br.close();
    }
} public class Main {

    public static void main(String[] Args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int p, q, r;
        p = Integer.parseInt(st.nextToken());
        q = Integer.parseInt(st.nextToken());
        r = Integer.parseInt(st.nextToken());
        if(p + q <= r + q && p + q <= p + r){
            System.out.println(p + q);
        }
        else if(p + r <= p + q && p + r <= r + q){
            System.out.println(p + r);
        }
        else if(r + q <= p + q && r + q <= p + r){
            System.out.println(r + q);
        }

        br.close();
    }
} Main
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] Args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int p, q, r;
        p = Integer.parseInt(st.nextToken());
        q = Integer.parseInt(st.nextToken());
        r = Integer.parseInt(st.nextToken());
        if(p + q <= r + q && p + q <= p + r){
            System.out.println(p + q);
        }
        else if(p + r <= p + q && p + r <= r + q){
            System.out.println(p + r);
        }
        else if(r + q <= p + q && r + q <= p + r){
            System.out.println(r + q);
        }

        br.close();
    }
}
