import java.util.Scanner;
import java.util.Arrays;


public 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 dist[] = new int[3];
        dist[0] = p;
        dist[1] = q;
        dist[2] = r;

        Arrays.sort(dist);

        System.out.println(dist[0]+dist[1]);

        sc.close();
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public 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 dist[] = new int[3];
        dist[0] = p;
        dist[1] = q;
        dist[2] = r;

        Arrays.sort(dist);

        System.out.println(dist[0]+dist[1]);

        sc.close();
    }
} 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 dist[] = new int[3];
        dist[0] = p;
        dist[1] = q;
        dist[2] = r;

        Arrays.sort(dist);

        System.out.println(dist[0]+dist[1]);

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);


        int p = sc.nextInt();
        int q = sc.nextInt();
        int r = sc.nextInt();

        int dist[] = new int[3];
        dist[0] = p;
        dist[1] = q;
        dist[2] = r;

        Arrays.sort(dist);

        System.out.println(dist[0]+dist[1]);

        sc.close();
    } 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 dist[] = new int[3]; dist new int[3] 3 dist[0] = p dist[0] dist 0 p dist[1] = q dist[1] dist 1 q dist[2] = r dist[2] dist 2 r Arrays.sort(dist) Arrays.sort Arrays dist System.out.println(dist[0]+dist[1]) System.out.println System.out System System.out dist[0]+dist[1] dist[0] dist 0 dist[1] dist 1 sc.close() sc.close sc String[] args args public 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 dist[] = new int[3];
        dist[0] = p;
        dist[1] = q;
        dist[2] = r;

        Arrays.sort(dist);

        System.out.println(dist[0]+dist[1]);

        sc.close();
    }
} public 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 dist[] = new int[3];
        dist[0] = p;
        dist[1] = q;
        dist[2] = r;

        Arrays.sort(dist);

        System.out.println(dist[0]+dist[1]);

        sc.close();
    }
} Main
import java.util.Scanner;
import java.util.Arrays;


public 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 dist[] = new int[3];
        dist[0] = p;
        dist[1] = q;
        dist[2] = r;

        Arrays.sort(dist);

        System.out.println(dist[0]+dist[1]);

        sc.close();
    }
}