import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.TreeMap;

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();
        sc.close();
        int ans;
        if (P<Q){
            if (Q<R){
                ans = P + Q;
            } else {
                ans = P + R;
            }
        } else {
            if (P<R){
                ans = P + Q;
            } else {
                ans = Q + R;
            }
        }
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.TreeMap; TreeMap 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();
        sc.close();
        int ans;
        if (P<Q){
            if (Q<R){
                ans = P + Q;
            } else {
                ans = P + R;
            }
        } else {
            if (P<R){
                ans = P + Q;
            } else {
                ans = Q + R;
            }
        }
        System.out.println(ans);
    }
} 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();
        sc.close();
        int ans;
        if (P<Q){
            if (Q<R){
                ans = P + Q;
            } else {
                ans = P + R;
            }
        } else {
            if (P<R){
                ans = P + Q;
            } else {
                ans = Q + R;
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int P = sc.nextInt();
        int Q = sc.nextInt();
        int R = sc.nextInt();
        sc.close();
        int ans;
        if (P<Q){
            if (Q<R){
                ans = P + Q;
            } else {
                ans = P + R;
            }
        } else {
            if (P<R){
                ans = P + Q;
            } else {
                ans = Q + R;
            }
        }
        System.out.println(ans);
    } 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 sc.close() sc.close sc int ans; ans if (P<Q){
            if (Q<R){
                ans = P + Q;
            } else {
                ans = P + R;
            }
        } else {
            if (P<R){
                ans = P + Q;
            } else {
                ans = Q + R;
            }
        } P<Q P Q {
            if (Q<R){
                ans = P + Q;
            } else {
                ans = P + R;
            }
        } if (Q<R){
                ans = P + Q;
            } else {
                ans = P + R;
            } Q<R Q R {
                ans = P + Q;
            } ans = P + Q ans P + Q P Q {
                ans = P + R;
            } ans = P + R ans P + R P R {
            if (P<R){
                ans = P + Q;
            } else {
                ans = Q + R;
            }
        } if (P<R){
                ans = P + Q;
            } else {
                ans = Q + R;
            } P<R P R {
                ans = P + Q;
            } ans = P + Q ans P + Q P Q {
                ans = Q + R;
            } ans = Q + R ans Q + R Q R System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.TreeMap;

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();
        sc.close();
        int ans;
        if (P<Q){
            if (Q<R){
                ans = P + Q;
            } else {
                ans = P + R;
            }
        } else {
            if (P<R){
                ans = P + Q;
            } else {
                ans = Q + R;
            }
        }
        System.out.println(ans);
    }
}