#include <iostream>
using namespace std;
int main() {
int tab[1000];
int i = 0;
do {
cin >> tab[i];
i++;
} while(tab[i-1]!=-1);
cout << (tab[1]+tab[i-3]/2.0);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkKCWludCB0YWJbMTAwMF07CglpbnQgaSA9IDA7CglkbyB7CgkJY2luID4+IHRhYltpXTsKCQlpKys7Cgl9IHdoaWxlKHRhYltpLTFdIT0tMSk7Cgljb3V0IDw8ICh0YWJbMV0rdGFiW2ktM10vMi4wKTsKCglyZXR1cm4gMDsKfQ==