#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int an[3];
  while (cin >> an[0] >> an[1] >> an[2]) {
    sort(an, an + 3);
    int x = an[0] % 3, y = an[1] % 3, z = an[2] % 3;
    int sum = 0;
    sum += an[0] / 3;
    sum += an[1] / 3;
    sum += an[2] / 3;
    int an1[3] = {x, y, z};
    sort(an1, an1 + 3);
    if (an[0] == 0 && an[1] == 2 && an[2] == 2)
      cout << 0 << endl;
    else if (an1[0] == 0 && an1[1] == 2 && an1[2] == 2 && an[0] != 0) {
      sum += 1;
      cout << sum << endl;
    } else {
      sort(an, an + 3);
      long long int a = an[0], b = an[1], c = an[2];
      long long int min = an[0];
      long long int sum1 = 0;
      sum1 += min;
      an[1] -= min;
      an[2] -= min;
      sum1 += an[1] / 3;
      sum1 += an[2] / 3;
      long long int sum2 = 0;
      an[0] = a;
      an[1] = b;
      an[2] = c;
      sum2 += an[0] / 3;
      sum2 += an[1] / 3;
      sum2 += an[2] / 3;
      an[0] = an[0] - (an[0] / 3) * 3;
      an[1] = an[1] - (an[1] / 3) * 3;
      an[2] = an[2] - (an[2] / 3) * 3;
      sort(an, an + 3);
      min = an[0];
      sum2 += min;
      if (sum1 >= sum2)
        cout << sum1 << endl;
      else
        cout << sum2 << endl;
    }
  }
  return (0);
}

### Prompt

Please formulate a CPP solution to the following problem:

Fox Ciel has some flowers: r red flowers, g green flowers and b blue flowers. She wants to use these flowers to make several bouquets. There are 4 types of bouquets:

  * To make a "red bouquet", it needs 3 red flowers. 
  * To make a "green bouquet", it needs 3 green flowers. 
  * To make a "blue bouquet", it needs 3 blue flowers. 
  * To make a "mixing bouquet", it needs 1 red, 1 green and 1 blue flower. 



Help Fox Ciel to find the maximal number of bouquets she can make.

Input

The first line contains three integers r, g and b (0 ≤ r, g, b ≤ 109) — the number of red, green and blue flowers.

Output

Print the maximal number of bouquets Fox Ciel can make.

Examples

Input

3 6 9


Output

6


Input

4 4 4


Output

4


Input

0 0 0


Output

0

Note

In test case 1, we can make 1 red bouquet, 2 green bouquets and 3 blue bouquets.

In test case 2, we can make 1 red, 1 green, 1 blue and 1 mixing bouquet.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int an[3];
  while (cin >> an[0] >> an[1] >> an[2]) {
    sort(an, an + 3);
    int x = an[0] % 3, y = an[1] % 3, z = an[2] % 3;
    int sum = 0;
    sum += an[0] / 3;
    sum += an[1] / 3;
    sum += an[2] / 3;
    int an1[3] = {x, y, z};
    sort(an1, an1 + 3);
    if (an[0] == 0 && an[1] == 2 && an[2] == 2)
      cout << 0 << endl;
    else if (an1[0] == 0 && an1[1] == 2 && an1[2] == 2 && an[0] != 0) {
      sum += 1;
      cout << sum << endl;
    } else {
      sort(an, an + 3);
      long long int a = an[0], b = an[1], c = an[2];
      long long int min = an[0];
      long long int sum1 = 0;
      sum1 += min;
      an[1] -= min;
      an[2] -= min;
      sum1 += an[1] / 3;
      sum1 += an[2] / 3;
      long long int sum2 = 0;
      an[0] = a;
      an[1] = b;
      an[2] = c;
      sum2 += an[0] / 3;
      sum2 += an[1] / 3;
      sum2 += an[2] / 3;
      an[0] = an[0] - (an[0] / 3) * 3;
      an[1] = an[1] - (an[1] / 3) * 3;
      an[2] = an[2] - (an[2] / 3) * 3;
      sort(an, an + 3);
      min = an[0];
      sum2 += min;
      if (sum1 >= sum2)
        cout << sum1 << endl;
      else
        cout << sum2 << endl;
    }
  }
  return (0);
}

```