#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const double eps = 1e-9;
long double pi = 3.14159265358979323846264338327950;
long double e = 2.7182818284590452353602874713527;
long long ans;
int main() {
  vector<long long> v(15);
  for (int i = 0; i < 14; i++) {
    cin >> v[i];
  }
  for (int i = 0; i < 14; i++) {
    if (v[i] > 0) {
      long long crScore = 0, times = v[i] / 14;
      vector<long long> cr(15);
      cr = v;
      cr[i] = 0;
      for (int k = 0; k < 14; k++) {
        cr[k] += times;
      }
      long long rem = v[i] % 14;
      for (int k = i + 1; rem > 0 && k < 14; ++k) {
        cr[k]++;
        rem--;
      }
      int k = 0;
      while (rem > 0) {
        cr[k++]++;
        rem--;
      }
      for (int j = 0; j < 14; j++) {
        if (cr[j] % 2 == 0) crScore += cr[j];
      }
      ans = max(ans, crScore);
    }
  }
  cout << ans << endl;
  return 0;
}

### Prompt

Construct a cpp code solution to the problem outlined:

Mancala is a game famous in the Middle East. It is played on a board that consists of 14 holes. 

<image>

Initially, each hole has a_i stones. When a player makes a move, he chooses a hole which contains a positive number of stones. He takes all the stones inside it and then redistributes these stones one by one in the next holes in a counter-clockwise direction.

Note that the counter-clockwise order means if the player takes the stones from hole i, he will put one stone in the (i+1)-th hole, then in the (i+2)-th, etc. If he puts a stone in the 14-th hole, the next one will be put in the first hole.

After the move, the player collects all the stones from holes that contain even number of stones. The number of stones collected by player is the score, according to Resli.

Resli is a famous Mancala player. He wants to know the maximum score he can obtain after one move.

Input

The only line contains 14 integers a_1, a_2, …, a_{14} (0 ≤ a_i ≤ 10^9) — the number of stones in each hole.

It is guaranteed that for any i (1≤ i ≤ 14) a_i is either zero or odd, and there is at least one stone in the board.

Output

Output one integer, the maximum possible score after one move.

Examples

Input

0 1 1 0 0 0 0 0 0 7 0 0 0 0


Output

4


Input

5 1 1 1 1 0 0 0 0 0 0 0 0 0


Output

8

Note

In the first test case the board after the move from the hole with 7 stones will look like 1 2 2 0 0 0 0 0 0 0 1 1 1 1. Then the player collects the even numbers and ends up with a score equal to 4.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const double eps = 1e-9;
long double pi = 3.14159265358979323846264338327950;
long double e = 2.7182818284590452353602874713527;
long long ans;
int main() {
  vector<long long> v(15);
  for (int i = 0; i < 14; i++) {
    cin >> v[i];
  }
  for (int i = 0; i < 14; i++) {
    if (v[i] > 0) {
      long long crScore = 0, times = v[i] / 14;
      vector<long long> cr(15);
      cr = v;
      cr[i] = 0;
      for (int k = 0; k < 14; k++) {
        cr[k] += times;
      }
      long long rem = v[i] % 14;
      for (int k = i + 1; rem > 0 && k < 14; ++k) {
        cr[k]++;
        rem--;
      }
      int k = 0;
      while (rem > 0) {
        cr[k++]++;
        rem--;
      }
      for (int j = 0; j < 14; j++) {
        if (cr[j] % 2 == 0) crScore += cr[j];
      }
      ans = max(ans, crScore);
    }
  }
  cout << ans << endl;
  return 0;
}

```