import java.util.Scanner;

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();
        
        if (p <= q && q <= r) {
            System.out.println((p + q));
        } else if (p <= r && r <= q) {
            System.out.println((p + r));
        } else if (q <= p && p <= r) {
            System.out.println((q + p));
        } else if (q <= r && r <= p) {
            System.out.println((q + r));
        } else if (r <= p && p <= q) {
            System.out.println((r + p));
        } else if (r <= q && q <= p) {
            System.out.println((r + q));
        }

		sc.close();
	}
} import java.util.Scanner; Scanner 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();
        
        if (p <= q && q <= r) {
            System.out.println((p + q));
        } else if (p <= r && r <= q) {
            System.out.println((p + r));
        } else if (q <= p && p <= r) {
            System.out.println((q + p));
        } else if (q <= r && r <= p) {
            System.out.println((q + r));
        } else if (r <= p && p <= q) {
            System.out.println((r + p));
        } else if (r <= q && q <= p) {
            System.out.println((r + q));
        }

		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();
        
        if (p <= q && q <= r) {
            System.out.println((p + q));
        } else if (p <= r && r <= q) {
            System.out.println((p + r));
        } else if (q <= p && p <= r) {
            System.out.println((q + p));
        } else if (q <= r && r <= p) {
            System.out.println((q + r));
        } else if (r <= p && p <= q) {
            System.out.println((r + p));
        } else if (r <= q && q <= p) {
            System.out.println((r + q));
        }

		sc.close();
	} main {
		Scanner sc = new Scanner((System.in));
        int p = sc.nextInt();
        int q = sc.nextInt();
        int r = sc.nextInt();
        
        if (p <= q && q <= r) {
            System.out.println((p + q));
        } else if (p <= r && r <= q) {
            System.out.println((p + r));
        } else if (q <= p && p <= r) {
            System.out.println((q + p));
        } else if (q <= r && r <= p) {
            System.out.println((q + r));
        } else if (r <= p && p <= q) {
            System.out.println((r + p));
        } else if (r <= q && q <= p) {
            System.out.println((r + q));
        }

		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 if (p <= q && q <= r) {
            System.out.println((p + q));
        } else if (p <= r && r <= q) {
            System.out.println((p + r));
        } else if (q <= p && p <= r) {
            System.out.println((q + p));
        } else if (q <= r && r <= p) {
            System.out.println((q + r));
        } else if (r <= p && p <= q) {
            System.out.println((r + p));
        } else if (r <= q && q <= p) {
            System.out.println((r + q));
        } p <= q && q <= r p <= q p q q <= r q r {
            System.out.println((p + q));
        } System.out.println((p + q)) System.out.println System.out System System.out (p + q) p q if (p <= r && r <= q) {
            System.out.println((p + r));
        } else if (q <= p && p <= r) {
            System.out.println((q + p));
        } else if (q <= r && r <= p) {
            System.out.println((q + r));
        } else if (r <= p && p <= q) {
            System.out.println((r + p));
        } else if (r <= q && q <= p) {
            System.out.println((r + q));
        } p <= r && r <= q p <= r p r r <= q r q {
            System.out.println((p + r));
        } System.out.println((p + r)) System.out.println System.out System System.out (p + r) p r if (q <= p && p <= r) {
            System.out.println((q + p));
        } else if (q <= r && r <= p) {
            System.out.println((q + r));
        } else if (r <= p && p <= q) {
            System.out.println((r + p));
        } else if (r <= q && q <= p) {
            System.out.println((r + q));
        } q <= p && p <= r q <= p q p p <= r p r {
            System.out.println((q + p));
        } System.out.println((q + p)) System.out.println System.out System System.out (q + p) q p if (q <= r && r <= p) {
            System.out.println((q + r));
        } else if (r <= p && p <= q) {
            System.out.println((r + p));
        } else if (r <= q && q <= p) {
            System.out.println((r + q));
        } q <= r && r <= p q <= r q r r <= p r p {
            System.out.println((q + r));
        } System.out.println((q + r)) System.out.println System.out System System.out (q + r) q r if (r <= p && p <= q) {
            System.out.println((r + p));
        } else if (r <= q && q <= p) {
            System.out.println((r + q));
        } r <= p && p <= q r <= p r p p <= q p q {
            System.out.println((r + p));
        } System.out.println((r + p)) System.out.println System.out System System.out (r + p) r p if (r <= q && q <= p) {
            System.out.println((r + q));
        } r <= q && q <= p r <= q r q q <= p q p {
            System.out.println((r + q));
        } System.out.println((r + q)) System.out.println System.out System System.out (r + q) r q 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();
        
        if (p <= q && q <= r) {
            System.out.println((p + q));
        } else if (p <= r && r <= q) {
            System.out.println((p + r));
        } else if (q <= p && p <= r) {
            System.out.println((q + p));
        } else if (q <= r && r <= p) {
            System.out.println((q + r));
        } else if (r <= p && p <= q) {
            System.out.println((r + p));
        } else if (r <= q && q <= p) {
            System.out.println((r + q));
        }

		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();
        
        if (p <= q && q <= r) {
            System.out.println((p + q));
        } else if (p <= r && r <= q) {
            System.out.println((p + r));
        } else if (q <= p && p <= r) {
            System.out.println((q + p));
        } else if (q <= r && r <= p) {
            System.out.println((q + r));
        } else if (r <= p && p <= q) {
            System.out.println((r + p));
        } else if (r <= q && q <= p) {
            System.out.println((r + q));
        }

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

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();
        
        if (p <= q && q <= r) {
            System.out.println((p + q));
        } else if (p <= r && r <= q) {
            System.out.println((p + r));
        } else if (q <= p && p <= r) {
            System.out.println((q + p));
        } else if (q <= r && r <= p) {
            System.out.println((q + r));
        } else if (r <= p && p <= q) {
            System.out.println((r + p));
        } else if (r <= q && q <= p) {
            System.out.println((r + q));
        }

		sc.close();
	}
}
