
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        new Main().run();
    }

    public void run() {
        Scanner scanner = new Scanner(System.in);
        int P = scanner.nextInt();
        int Q = scanner.nextInt();
        int R = scanner.nextInt();

        int sum = 0;
        if (P >= Q && P >= R) {
            sum = Q + R;
        }
        if (Q >= P && Q >= R) {
            sum = R + P;
        }
        if (R >= Q && R >= P) {
            sum = Q + P;
        }
        System.out.println(sum);
    }

} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        new Main().run();
    }

    public void run() {
        Scanner scanner = new Scanner(System.in);
        int P = scanner.nextInt();
        int Q = scanner.nextInt();
        int R = scanner.nextInt();

        int sum = 0;
        if (P >= Q && P >= R) {
            sum = Q + R;
        }
        if (Q >= P && Q >= R) {
            sum = R + P;
        }
        if (R >= Q && R >= P) {
            sum = Q + P;
        }
        System.out.println(sum);
    }

} Main public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args public void run() {
        Scanner scanner = new Scanner(System.in);
        int P = scanner.nextInt();
        int Q = scanner.nextInt();
        int R = scanner.nextInt();

        int sum = 0;
        if (P >= Q && P >= R) {
            sum = Q + R;
        }
        if (Q >= P && Q >= R) {
            sum = R + P;
        }
        if (R >= Q && R >= P) {
            sum = Q + P;
        }
        System.out.println(sum);
    } run {
        Scanner scanner = new Scanner(System.in);
        int P = scanner.nextInt();
        int Q = scanner.nextInt();
        int R = scanner.nextInt();

        int sum = 0;
        if (P >= Q && P >= R) {
            sum = Q + R;
        }
        if (Q >= P && Q >= R) {
            sum = R + P;
        }
        if (R >= Q && R >= P) {
            sum = Q + P;
        }
        System.out.println(sum);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int P = scanner.nextInt(); P scanner.nextInt() scanner.nextInt scanner int Q = scanner.nextInt(); Q scanner.nextInt() scanner.nextInt scanner int R = scanner.nextInt(); R scanner.nextInt() scanner.nextInt scanner int sum = 0; sum 0 if (P >= Q && P >= R) {
            sum = Q + R;
        } P >= Q && P >= R P >= Q P Q P >= R P R {
            sum = Q + R;
        } sum = Q + R sum Q + R Q R if (Q >= P && Q >= R) {
            sum = R + P;
        } Q >= P && Q >= R Q >= P Q P Q >= R Q R {
            sum = R + P;
        } sum = R + P sum R + P R P if (R >= Q && R >= P) {
            sum = Q + P;
        } R >= Q && R >= P R >= Q R Q R >= P R P {
            sum = Q + P;
        } sum = Q + P sum Q + P Q P System.out.println(sum) System.out.println System.out System System.out sum public class Main {
    public static void main(String[] args) {
        new Main().run();
    }

    public void run() {
        Scanner scanner = new Scanner(System.in);
        int P = scanner.nextInt();
        int Q = scanner.nextInt();
        int R = scanner.nextInt();

        int sum = 0;
        if (P >= Q && P >= R) {
            sum = Q + R;
        }
        if (Q >= P && Q >= R) {
            sum = R + P;
        }
        if (R >= Q && R >= P) {
            sum = Q + P;
        }
        System.out.println(sum);
    }

} public class Main {
    public static void main(String[] args) {
        new Main().run();
    }

    public void run() {
        Scanner scanner = new Scanner(System.in);
        int P = scanner.nextInt();
        int Q = scanner.nextInt();
        int R = scanner.nextInt();

        int sum = 0;
        if (P >= Q && P >= R) {
            sum = Q + R;
        }
        if (Q >= P && Q >= R) {
            sum = R + P;
        }
        if (R >= Q && R >= P) {
            sum = Q + P;
        }
        System.out.println(sum);
    }

} Main

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        new Main().run();
    }

    public void run() {
        Scanner scanner = new Scanner(System.in);
        int P = scanner.nextInt();
        int Q = scanner.nextInt();
        int R = scanner.nextInt();

        int sum = 0;
        if (P >= Q && P >= R) {
            sum = Q + R;
        }
        if (Q >= P && Q >= R) {
            sum = R + P;
        }
        if (R >= Q && R >= P) {
            sum = Q + P;
        }
        System.out.println(sum);
    }

}