import java.util.Scanner;

public class Main {
    public static void main(String[] args) {


        Scanner sc = new Scanner(System.in);
        int p = Integer.parseInt(sc.next());
        int q = Integer.parseInt(sc.next());
        int r = Integer.parseInt(sc.next());
        int min = 1000;

        if (p + q < 1000) {
            min = p + q;
        }
        if (p + r < min) {
            min = p + r;
        }
        if (q + r < min) {
            min = q + r;
        }
        System.out.println(min);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {


        Scanner sc = new Scanner(System.in);
        int p = Integer.parseInt(sc.next());
        int q = Integer.parseInt(sc.next());
        int r = Integer.parseInt(sc.next());
        int min = 1000;

        if (p + q < 1000) {
            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);
        int p = Integer.parseInt(sc.next());
        int q = Integer.parseInt(sc.next());
        int r = Integer.parseInt(sc.next());
        int min = 1000;

        if (p + q < 1000) {
            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);
        int p = Integer.parseInt(sc.next());
        int q = Integer.parseInt(sc.next());
        int r = Integer.parseInt(sc.next());
        int min = 1000;

        if (p + q < 1000) {
            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) int p = Integer.parseInt(sc.next()); p Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int q = Integer.parseInt(sc.next()); q Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int r = Integer.parseInt(sc.next()); r Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int min = 1000; min 1000 if (p + q < 1000) {
            min = p + q;
        } p + q < 1000 p + q p q 1000 {
            min = p + q;
        } 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 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 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);
        int p = Integer.parseInt(sc.next());
        int q = Integer.parseInt(sc.next());
        int r = Integer.parseInt(sc.next());
        int min = 1000;

        if (p + q < 1000) {
            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);
        int p = Integer.parseInt(sc.next());
        int q = Integer.parseInt(sc.next());
        int r = Integer.parseInt(sc.next());
        int min = 1000;

        if (p + q < 1000) {
            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.Scanner;

public class Main {
    public static void main(String[] args) {


        Scanner sc = new Scanner(System.in);
        int p = Integer.parseInt(sc.next());
        int q = Integer.parseInt(sc.next());
        int r = Integer.parseInt(sc.next());
        int min = 1000;

        if (p + q < 1000) {
            min = p + q;
        }
        if (p + r < min) {
            min = p + r;
        }
        if (q + r < min) {
            min = q + r;
        }
        System.out.println(min);
    }
}