#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int cost[5];
	
	for (int i = 0; i < 5; i++){
		cin >> cost[i];
	}
	
	int total = min(cost[0], min(cost[1], cost[2])) + min(cost[3], cost[4]);
	total -= 50;
	
	cout << total << endl;
	
	return (0);
}