#include <iostream>
#include <cmath>
using namespace std;

int main() {
    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;

    int tong_le = (a % 2) * a + (b % 2) * b + (c % 2) * c + (d % 2) * d + (e % 2) * e;
    int tong_chan = ((a + 1) % 2) * a + ((b + 1) % 2) * b + ((c + 1) % 2) * c + ((d + 1) % 2) * d + ((e + 1) % 2) * e;

    cout << abs(tong_le - tong_chan);
    return 0;
}