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