#include #include #include using namespace std; int main() { int N; cin >> N; vector vec(N, 0); vector memo(N, 0); for(int i = 0; i < N; i++) cin >> vec[i]; memo[0] = vec[0] / 2; for(int i = 1; i < N; i++) { memo[i] = memo[i - 1] + vec[i] / 2; } int ans = 0; for(int i = 0; i < N; i++) { ans = max(memo[N - 1] + vec[i] - vec[i] / 2 , ans); } cout << ans << endl; }