#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v[50];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v, v + n);
  int ans = 0;
  for (int i = 1; i < n; i++) {
    ans += (v[i - 1] + v[i]) / 2;
  }
  cout << ans << endl;
  return 0;
}
