import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;

void main()
{
	int[3] pasta;
	int[2] drink;
	foreach (i; 0..3) {
		pasta[i] = readln.chomp.to!int;
	}
	foreach (i; 0..2) {
		drink[i] = readln.chomp.to!int;
	}

	writeln(pasta.array.sort[0]+drink.array.sort[0]-50);
}