import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {

		String[] strs;
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){

			String line = br.readLine();
			strs = line.split(" ");
		} catch (IOException e) {

			return;
		}
		int p = Integer.parseInt(strs[0]);
		int q = Integer.parseInt(strs[1]);
		int r = Integer.parseInt(strs[2]);

		int minTime = p + q;
		if (minTime > q + r) {

			minTime = q + r;
		}
		if (minTime > r + p) {

			minTime = r + p;
		}
		System.out.println(minTime);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) {

		String[] strs;
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){

			String line = br.readLine();
			strs = line.split(" ");
		} catch (IOException e) {

			return;
		}
		int p = Integer.parseInt(strs[0]);
		int q = Integer.parseInt(strs[1]);
		int r = Integer.parseInt(strs[2]);

		int minTime = p + q;
		if (minTime > q + r) {

			minTime = q + r;
		}
		if (minTime > r + p) {

			minTime = r + p;
		}
		System.out.println(minTime);
	}
} Main public static void main(String[] args) {

		String[] strs;
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){

			String line = br.readLine();
			strs = line.split(" ");
		} catch (IOException e) {

			return;
		}
		int p = Integer.parseInt(strs[0]);
		int q = Integer.parseInt(strs[1]);
		int r = Integer.parseInt(strs[2]);

		int minTime = p + q;
		if (minTime > q + r) {

			minTime = q + r;
		}
		if (minTime > r + p) {

			minTime = r + p;
		}
		System.out.println(minTime);
	} main {

		String[] strs;
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){

			String line = br.readLine();
			strs = line.split(" ");
		} catch (IOException e) {

			return;
		}
		int p = Integer.parseInt(strs[0]);
		int q = Integer.parseInt(strs[1]);
		int r = Integer.parseInt(strs[2]);

		int minTime = p + q;
		if (minTime > q + r) {

			minTime = q + r;
		}
		if (minTime > r + p) {

			minTime = r + p;
		}
		System.out.println(minTime);
	} String[] strs; strs try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){

			String line = br.readLine();
			strs = line.split(" ");
		} catch (IOException e) {

			return;
		} catch (IOException e) {

			return;
		} IOException e {

			return;
		} return; {

			String line = br.readLine();
			strs = line.split(" ");
		} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String line = br.readLine(); line br.readLine() br.readLine br strs = line.split(" ") strs line.split(" ") line.split line " " int p = Integer.parseInt(strs[0]); p Integer.parseInt(strs[0]) Integer.parseInt Integer strs[0] strs 0 int q = Integer.parseInt(strs[1]); q Integer.parseInt(strs[1]) Integer.parseInt Integer strs[1] strs 1 int r = Integer.parseInt(strs[2]); r Integer.parseInt(strs[2]) Integer.parseInt Integer strs[2] strs 2 int minTime = p + q; minTime p + q p q if (minTime > q + r) {

			minTime = q + r;
		} minTime > q + r minTime q + r q r {

			minTime = q + r;
		} minTime = q + r minTime q + r q r if (minTime > r + p) {

			minTime = r + p;
		} minTime > r + p minTime r + p r p {

			minTime = r + p;
		} minTime = r + p minTime r + p r p System.out.println(minTime) System.out.println System.out System System.out minTime String[] args args public class Main {

	public static void main(String[] args) {

		String[] strs;
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){

			String line = br.readLine();
			strs = line.split(" ");
		} catch (IOException e) {

			return;
		}
		int p = Integer.parseInt(strs[0]);
		int q = Integer.parseInt(strs[1]);
		int r = Integer.parseInt(strs[2]);

		int minTime = p + q;
		if (minTime > q + r) {

			minTime = q + r;
		}
		if (minTime > r + p) {

			minTime = r + p;
		}
		System.out.println(minTime);
	}
} public class Main {

	public static void main(String[] args) {

		String[] strs;
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){

			String line = br.readLine();
			strs = line.split(" ");
		} catch (IOException e) {

			return;
		}
		int p = Integer.parseInt(strs[0]);
		int q = Integer.parseInt(strs[1]);
		int r = Integer.parseInt(strs[2]);

		int minTime = p + q;
		if (minTime > q + r) {

			minTime = q + r;
		}
		if (minTime > r + p) {

			minTime = r + p;
		}
		System.out.println(minTime);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {

		String[] strs;
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){

			String line = br.readLine();
			strs = line.split(" ");
		} catch (IOException e) {

			return;
		}
		int p = Integer.parseInt(strs[0]);
		int q = Integer.parseInt(strs[1]);
		int r = Integer.parseInt(strs[2]);

		int minTime = p + q;
		if (minTime > q + r) {

			minTime = q + r;
		}
		if (minTime > r + p) {

			minTime = r + p;
		}
		System.out.println(minTime);
	}
}