Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	return n
}

func main() {
	sc.Split(bufio.ScanWords)

	a, b, c, d, e := nextInt(), nextInt(), nextInt(), nextInt(), nextInt()
	x := a
	if b < x {
		x = b
	}
	if c < x {
		x = c
	}
	y := d
	if e < y {
		y = e
	}

	fmt.Println(x + y - 50)
}

C++: #include<iostream>
using namespace std;
int main(){
int x,y,z,w,q;
cin>>x>>y>>z>>w>>q;
if(y>x&&z>x){
if(w>q){cout<<x+q-50<<endl;} 
else if(w<q){cout<<x+w-50<<endl;}
}

else if(x>y&&z>y){
if(w>q){cout<<y+q-50<<endl;} 
else if(w<q){cout<<y+w-50<<endl;}
}

else if(x>z&&y>z){
if(w>q){cout<<z+q-50<<endl;} 
else if(w<q){cout<<z+w-50<<endl;}
}

return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
	int p[3],j[2],t,p2,j2;
	for(int i=0;i<3;i++)
		cin >>p[i];
	for(int i=0;i<2;i++)
		cin >>j[i];
	

	for(int i=0;i<3;i++){
		for(int k=0;k<2;k++)
		if(p[k]>p[k+1]){
			t=p[k];
			p[k]=p[k+1];
			p[k+1]=t;
			
			}
		}
	p2=p[0];

	if(j[0]>j[1])
		j2=j[1];
	if(j[0]<=j[1])
		j2=j[0];
	cout <<j2+p2-50 <<endl;


	return 0;
}

C++: #include <iostream>

#include <algorithm>
using namespace std;

int main(){
	int p1;
	int p2;
	int p3;
	int j1;
	int j2;	
        int p = min({ p1, min(p2, p3) });
	int j = min({ j1, j2 });
	cin >> p1 >> p2 >> p3 >> j1 >> j2;

	cout << p + j - 50<< endl;

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>

//#define PI 3.141592653589

using namespace std;



int main()
{
	int pasta[3];
	int juice[2];
	
	for (int i=0; i<3; i++) cin >> pasta[i];
	for (int i=0; i<2; i++) cin >> juice[i];
	sort(pasta, pasta+3);
	sort(juice, juice+3);
	
	cout << pasta[0] + juice[0] - 50 << endl;
	
	//for (int i=0; i<3; i++) cout << pasta[i] << endl;
	
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
#define INF ( 1 << 30 )
int main(){
  int a,b,c,d,e;
  cin >> a >> b >> c >> d >> e;
  cout << min(a,(min(b,c))) + min(d,e) - 50 << endl;
}

C++: #include <iostream>
#include <algorithm>
int main(){
	const int INF = 10000000;
	int min_p = INF, min_j = INF;
	for(int i=0;i<5;i++){
		int n;
		std::cin >> n;
		if(i < 3)
			min_p = std::min(min_p, n);
		else
			min_j = std::min(min_j, n);
	}
	std::cout << min_p + min_j - 50 << std::endl;
}

C++: #include <iostream>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

const int INF = 10000000;
using namespace std;
typedef long long  ll;
const int MAX = 10000;

/** Problem0565 : Lunch **/
int main()
{
	int minP=INF, minJ=INF;
	rep(i, 3) {
		int n;
		cin >> n;
		if (minP > n)
			minP = n;
	}
	rep(i, 2) {
		int n;
		cin >> n;
		if (minJ > n)
			minJ = n;
	}
	cout << minP + minJ - 50 << endl;
}

C++: #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <iterator>
using namespace std;

/*
const int MAX_E=2*(100-1);
const int MAX_V=100;
const long long int INF=100000000;
struct edge { int from,to,cost;};
edge es[MAX_E];
//int d[MAX_V];
int V,E;
void shortest_path(int s,int e,vector<int>& d);
int main(){
	int n,k;
	while(cin >> n >> k&&n!=0&&k!=0){
		int V=n;
		int E=2*(n-1);
		vector<int> land(V);
		int l=0;
		for(int i=0; i<E; ++i){
			es[i].cost=-1;
			es[i].from=-1;
			es[i].to=-1;
		}
		for(int i=0; i<k; ++k){
			int m;
			cin >> m;
			if(m==0){
				int a,b;
				cin >> a >> b;
				shortest_path(a,b,land);
				cout << land[b] << "\n";
			} else if(m==1){
				int c,d,e;
				cin >> c >> d >> e;
				es[l].from=c;
				es[l].to=d;
				es[l].cost=e;
				es[l+1].from=d;
				es[l+1].to=c;
				es[l+1].cost=e;
				l+=2;
			}
		}
	}
	return 0;
}

void shortest_path(int s,int e,vector<int>& d){
	cout << "ok1\n";
	for(int i=0; i<V; ++i) {
		cout << "ok\n";
		d[i]=INF;
	}
	d[s]=0;
	while(true){
		cout << "ok2\n";
		bool update=false;
		for(int i=0; i<E; ++i){
			edge e=es[i];
			if(d[e.from]!=INF&&d[e.to]>d[e.from]+e.cost){
				d[e.to]=d[e.from]+e.cost;
				update=true;
			}
		}
		if(!update) break;
	}
}
*/
/*
const int INF=100000000;
int main(){
	int n;
	while(cin >> n&&n!=0){
		vector<int> color;
		for(int i=0; i<n; ++i){
			int t;
			cin >> t;
			color.push_back(t);
		}
		int maxDel=INF;
		for(int i=0; i<n; ++i){
			for(int j=1; j<=3; ++j){
				if(color[i]==j) continue;
				int up=i-1;
				int down=i+1;
				int sum=0;
				int c=1;
				int col=j;
				while(1){
					int nCal=-1;
					while(1){
						if(up<0) break;
						if(color[up]!=col){
							nCal=color[up];
							break;
						}
						up--;
						c++;
					}
					while(1){
						if(down>=n) break;
						if(color[down]!=col){
							if(nCal==-1) nCal=color[down];
							break;
						}
						++down;
						++c;
					}
					if(c>=4){
						sum+=c;
					} else{
						break;
					}
					c=0;
					if(nCal==-1){
						break;
					}else{
						col=nCal;
					}
				}
				maxDel=min(maxDel,n-sum);
			}
		}
		cout << maxDel << "\n";
	}
	return 0;
}
*/

int main(){
	int m=10000,n=100000;
	for(int i=0; i<3; ++i){
		int tmp;
		cin >> tmp;
		m=min(m,tmp);
	}
	for(int i=0; i<2; ++i){
		int tmp;
		cin >> tmp;
		n=min(tmp,n);
	}
	cout << m+n-50 << "\n";
	return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<iostream>

using namespace std;

main(){
  int p=2001,j=2001,temp;
  for(int i=0;i<3;i++){
    scanf("%d",&temp);
    p=min(p,temp);
  }
  
  for(int i=0;i<2;i++){
    scanf("%d",&temp);
    j=min(j,temp);
  }

  printf("%d\n",p+j-50);

}

C++: #include <iostream>
#include <algorithm>
using namespace std;

int main()
{
	int price[5];

	for (int i = 0; i < 5; i++){
		cin >> price[i];
	}

	sort(price, price + 3);
	
	cout << price[0] + min(price[3], price[4]) - 50 << endl;

	return (0);
}

C++: #include <iostream>
#include <algorithm>
using namespace std;

int p[3];
int s[2];

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	for(int i = 0; i < 3; ++i){
		cin >> p[i];
	}
	
	for(int i = 0; i < 2; ++i){
		cin >> s[i];
	}
	
	int ans = 5000;
	for(int i = 0; i < 3; ++i){
		for(int j = 0; j < 2; ++j){
			ans = min (ans, p[i] + s[j] - 50);
		}
	}
	
	cout << ans << endl;
		
	return 0;
}

C++: #include <iostream>
using namespace std;

int main(void)
{
    int a,b,c,d,e;
    cin>>a>>b>>c>>d>>e;
    int f = min(a, min(b,c));
    int g = min(d,e);
    cout << f+g-50 << endl;
    return 0;
}

C++: #include<iostream>
using namespace std;

main(){
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  cout << min(a, min(b, c)) + min(d, e) - 50 << endl;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
#include <cstdio>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  vector<int> pasta(3);
  vector<int> jus(2);
  rep(i,3)cin>>pasta[i];
  rep(i,2)cin>>jus[i];
  sort(all(pasta));
  sort(all(jus));
  cout<<pasta[0]+jus[0]-50<<endl;

}

C++: #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
 
//const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
//const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
 
int main()
{
	int p[3];
	int j[2];
	REP(i, 3) cin >> p[i];
	REP(i, 2) cin >> j[i];

	int pmin = INF;
	REP(i, 3){
		if (pmin > p[i]) pmin = p[i];
	}
	int jmin;
	if (j[0] < j[1]) jmin = j[0];
	else jmin = j[1];

	cout << pmin + jmin - 50 << endl;


}