#include <bits/stdc++.h>
void Swap(int& a, int& b) {
  int temp = a;
  a = b;
  b = temp;
}
void InsertSor(int src[], int n) {
  for (int i = 1; i < n; ++i) {
    for (int j = i; j >= 1; --j) {
      Swap(src[i], src[j]);
    }
  }
}
int main() {
  int N;
  std::cin >> N;
  int* ana;
  ana = new int[N];
  for (int i = 0; i < N; i++) {
    std::cin >> ana[i];
  }
  InsertSor(ana, N);
  int sum = 0;
  for (int i = 0; i < N - 1; ++i) {
    sum += (ana[i] + ana[i + 1]) / 2;
  }
  std::cout << sum;
  delete[] ana;
  return 0;
}
