#include <iostream>
#include <vector>
using namespace std;
int min(vector<int>& inputs, int offset, int len)
{
int min = 2000;
vector<int>::iterator i = inputs.begin() + offset;
for (vector<int>::iterator it = i; it - i < len; it++) {
if (*it < min)
min = *it;
}
return min;
}
int main(void)
{
vector<int> inputs(5);
for (int i=0; i<5; i++)
cin >> inputs[i];
int pasta_min = min(inputs, 0, 3);
int juice_min = min(inputs, 3, 2);
cout << pasta_min + juice_min - 50 << endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1pbih2ZWN0b3I8aW50PiYgaW5wdXRzLCBpbnQgb2Zmc2V0LCBpbnQgbGVuKQp7CiAgaW50IG1pbiA9IDIwMDA7CiAgdmVjdG9yPGludD46Oml0ZXJhdG9yIGkgPSBpbnB1dHMuYmVnaW4oKSArIG9mZnNldDsKICBmb3IgKHZlY3RvcjxpbnQ+OjppdGVyYXRvciBpdCA9IGk7IGl0IC0gaSA8IGxlbjsgaXQrKykgewogICAgaWYgKCppdCA8IG1pbikKICAgICAgbWluID0gKml0OwogIH0KICByZXR1cm4gbWluOwp9CgppbnQgbWFpbih2b2lkKQp7CiAgdmVjdG9yPGludD4gaW5wdXRzKDUpOwogIGZvciAoaW50IGk9MDsgaTw1OyBpKyspCiAgICBjaW4gPj4gaW5wdXRzW2ldOwoKICBpbnQgcGFzdGFfbWluID0gbWluKGlucHV0cywgMCwgMyk7CiAgaW50IGp1aWNlX21pbiA9IG1pbihpbnB1dHMsIDMsIDIpOwoKICBjb3V0IDw8IHBhc3RhX21pbiArIGp1aWNlX21pbiAtIDUwIDw8IGVuZGw7Cn0K