#include<cstdio>

int main(){
	int min_ps=30000,min_j=30000,temp;

	for(int i=0;i<5;i++){
		scanf("%d",&temp);
		if(min_ps > temp && i < 3){
			min_ps = temp;
		}
		else if(min_j > temp){
			min_j = temp;
		}
	}
	printf("%d\n",min_ps+min_j-50);
	return 0;
}