import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] line1 = line.split(" ");
        int p = Integer.parseInt(line1[0]);
        int q = Integer.parseInt(line1[1]);
        int r = Integer.parseInt(line1[2]);
        int min = p + q;
        if(p + r < min)
        min = p + r;
        if(q + r < min)
        min = q + r;
        System.out.println(min);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] line1 = line.split(" ");
        int p = Integer.parseInt(line1[0]);
        int q = Integer.parseInt(line1[1]);
        int r = Integer.parseInt(line1[2]);
        int min = p + q;
        if(p + r < min)
        min = p + r;
        if(q + r < min)
        min = q + r;
        System.out.println(min);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] line1 = line.split(" ");
        int p = Integer.parseInt(line1[0]);
        int q = Integer.parseInt(line1[1]);
        int r = Integer.parseInt(line1[2]);
        int min = p + q;
        if(p + r < min)
        min = p + r;
        if(q + r < min)
        min = q + r;
        System.out.println(min);
    } main {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] line1 = line.split(" ");
        int p = Integer.parseInt(line1[0]);
        int q = Integer.parseInt(line1[1]);
        int r = Integer.parseInt(line1[2]);
        int min = p + q;
        if(p + r < min)
        min = p + r;
        if(q + r < min)
        min = q + r;
        System.out.println(min);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc String[] line1 = line.split(" "); line1 line.split(" ") line.split line " " int p = Integer.parseInt(line1[0]); p Integer.parseInt(line1[0]) Integer.parseInt Integer line1[0] line1 0 int q = Integer.parseInt(line1[1]); q Integer.parseInt(line1[1]) Integer.parseInt Integer line1[1] line1 1 int r = Integer.parseInt(line1[2]); r Integer.parseInt(line1[2]) Integer.parseInt Integer line1[2] line1 2 int min = p + q; min p + q p q if(p + r < min)
        min = p + r; p + r < min p + r p r min min = p + r min p + r p r if(q + r < min)
        min = q + r; q + r < min q + r q r min min = q + r min q + r q r System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] line1 = line.split(" ");
        int p = Integer.parseInt(line1[0]);
        int q = Integer.parseInt(line1[1]);
        int r = Integer.parseInt(line1[2]);
        int min = p + q;
        if(p + r < min)
        min = p + r;
        if(q + r < min)
        min = q + r;
        System.out.println(min);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] line1 = line.split(" ");
        int p = Integer.parseInt(line1[0]);
        int q = Integer.parseInt(line1[1]);
        int r = Integer.parseInt(line1[2]);
        int min = p + q;
        if(p + r < min)
        min = p + r;
        if(q + r < min)
        min = q + r;
        System.out.println(min);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] line1 = line.split(" ");
        int p = Integer.parseInt(line1[0]);
        int q = Integer.parseInt(line1[1]);
        int r = Integer.parseInt(line1[2]);
        int min = p + q;
        if(p + r < min)
        min = p + r;
        if(q + r < min)
        min = q + r;
        System.out.println(min);
    }
}