#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 20;
vector<int> v;
int cnt, a[N], b[N], has[N];
bool flag;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, q, cnt1 = 0, mi3 = 0, min2 = 0;
  cin >> n >> m >> q;
  int w = n, e = m, r = q;
  cnt += n / 3 + m / 3 + q / 3;
  n %= 3;
  m %= 3;
  q %= 3;
  int min1 = min(n, m);
  mi3 = min(min1, q);
  cnt += mi3;
  if (n > 0 && m > 0 && w != 0 && e != 0 && r != 0) {
    min1 = min(n, m);
    if (q > 0)
      min2 = min(min1, q);
    else
      min2 = min1;
  } else if (n > 0 && q > 0 && w != 0 && e != 0 && r != 0) {
    min2 = min(n, q);
  } else if (m > 0 && q > 0 && w != 0 && e != 0 && r != 0) {
    min2 = min(m, q);
  } else if (n > 0 && m == 0 && q == 0 && w != 0 && e != 0 && r != 0)
    min2 = n;
  else if (m > 0 && n == 0 && q == 0 && w != 0 && e != 0 && r != 0)
    min2 = m;
  else if (q > 0 && m == 0 && n == 0 && w != 0 && e != 0 && r != 0)
    min2 = q;
  cnt1 += min2;
  w -= min2;
  e -= min2;
  r -= min2;
  cnt1 += w / 3 + e / 3 + r / 3;
  int max1 = max(cnt, cnt1);
  cout << max1;
  return 0;
}

### Prompt

Please provide a Cpp coded solution to the problem described below:

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;
const int N = 1 << 20;
vector<int> v;
int cnt, a[N], b[N], has[N];
bool flag;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, q, cnt1 = 0, mi3 = 0, min2 = 0;
  cin >> n >> m >> q;
  int w = n, e = m, r = q;
  cnt += n / 3 + m / 3 + q / 3;
  n %= 3;
  m %= 3;
  q %= 3;
  int min1 = min(n, m);
  mi3 = min(min1, q);
  cnt += mi3;
  if (n > 0 && m > 0 && w != 0 && e != 0 && r != 0) {
    min1 = min(n, m);
    if (q > 0)
      min2 = min(min1, q);
    else
      min2 = min1;
  } else if (n > 0 && q > 0 && w != 0 && e != 0 && r != 0) {
    min2 = min(n, q);
  } else if (m > 0 && q > 0 && w != 0 && e != 0 && r != 0) {
    min2 = min(m, q);
  } else if (n > 0 && m == 0 && q == 0 && w != 0 && e != 0 && r != 0)
    min2 = n;
  else if (m > 0 && n == 0 && q == 0 && w != 0 && e != 0 && r != 0)
    min2 = m;
  else if (q > 0 && m == 0 && n == 0 && w != 0 && e != 0 && r != 0)
    min2 = q;
  cnt1 += min2;
  w -= min2;
  e -= min2;
  r -= min2;
  cnt1 += w / 3 + e / 3 + r / 3;
  int max1 = max(cnt, cnt1);
  cout << max1;
  return 0;
}

```