import java.util.Scanner;

public class Main {

    public static void main( String[] args ){

        Scanner in = new Scanner(System.in);

        String[] firstParams = in.nextLine().split(" ");
        int p = Integer.parseInt(firstParams[0]);
        int q = Integer.parseInt(firstParams[1]);
        int r = Integer.parseInt(firstParams[2]);

        int max = p;
        if( max < q )max = q;
        if( max < r )max = r;

        System.out.println(p + q + r - max );

    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main( String[] args ){

        Scanner in = new Scanner(System.in);

        String[] firstParams = in.nextLine().split(" ");
        int p = Integer.parseInt(firstParams[0]);
        int q = Integer.parseInt(firstParams[1]);
        int r = Integer.parseInt(firstParams[2]);

        int max = p;
        if( max < q )max = q;
        if( max < r )max = r;

        System.out.println(p + q + r - max );

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

        Scanner in = new Scanner(System.in);

        String[] firstParams = in.nextLine().split(" ");
        int p = Integer.parseInt(firstParams[0]);
        int q = Integer.parseInt(firstParams[1]);
        int r = Integer.parseInt(firstParams[2]);

        int max = p;
        if( max < q )max = q;
        if( max < r )max = r;

        System.out.println(p + q + r - max );

    } main {

        Scanner in = new Scanner(System.in);

        String[] firstParams = in.nextLine().split(" ");
        int p = Integer.parseInt(firstParams[0]);
        int q = Integer.parseInt(firstParams[1]);
        int r = Integer.parseInt(firstParams[2]);

        int max = p;
        if( max < q )max = q;
        if( max < r )max = r;

        System.out.println(p + q + r - max );

    } Scanner in = new Scanner(System.in); in new Scanner(System.in) String[] firstParams = in.nextLine().split(" "); firstParams in.nextLine().split(" ") in.nextLine().split in.nextLine() in.nextLine in " " int p = Integer.parseInt(firstParams[0]); p Integer.parseInt(firstParams[0]) Integer.parseInt Integer firstParams[0] firstParams 0 int q = Integer.parseInt(firstParams[1]); q Integer.parseInt(firstParams[1]) Integer.parseInt Integer firstParams[1] firstParams 1 int r = Integer.parseInt(firstParams[2]); r Integer.parseInt(firstParams[2]) Integer.parseInt Integer firstParams[2] firstParams 2 int max = p; max p if( max < q )max = q; max < q max q max = q max q if( max < r )max = r; max < r max r max = r max r System.out.println(p + q + r - max ) System.out.println System.out System System.out p + q + r - max p + q + r p + q + r p q r max String[] args args public class Main {

    public static void main( String[] args ){

        Scanner in = new Scanner(System.in);

        String[] firstParams = in.nextLine().split(" ");
        int p = Integer.parseInt(firstParams[0]);
        int q = Integer.parseInt(firstParams[1]);
        int r = Integer.parseInt(firstParams[2]);

        int max = p;
        if( max < q )max = q;
        if( max < r )max = r;

        System.out.println(p + q + r - max );

    }
} public class Main {

    public static void main( String[] args ){

        Scanner in = new Scanner(System.in);

        String[] firstParams = in.nextLine().split(" ");
        int p = Integer.parseInt(firstParams[0]);
        int q = Integer.parseInt(firstParams[1]);
        int r = Integer.parseInt(firstParams[2]);

        int max = p;
        if( max < q )max = q;
        if( max < r )max = r;

        System.out.println(p + q + r - max );

    }
} Main
import java.util.Scanner;

public class Main {

    public static void main( String[] args ){

        Scanner in = new Scanner(System.in);

        String[] firstParams = in.nextLine().split(" ");
        int p = Integer.parseInt(firstParams[0]);
        int q = Integer.parseInt(firstParams[1]);
        int r = Integer.parseInt(firstParams[2]);

        int max = p;
        if( max < q )max = q;
        if( max < r )max = r;

        System.out.println(p + q + r - max );

    }
}