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.
#include <bits/stdc++.h>
using namespace std;
long long r, g, b;
long long cnt;
long long min(long long a, long long b, long long c) {
  long long m;
  if (a > b)
    m = b;
  else
    m = a;
  if (m > c) m = c;
  return m;
}
int main() {
  bool flag[3];
  while (~scanf("%lld%lld%lld", &r, &g, &b)) {
    flag[0] = (r % 3 == 0);
    flag[1] = (g % 3 == 0);
    flag[2] = (b % 3 == 0);
    if (flag[0] && flag[1] && flag[2])
      printf("%lld\n", (r + g + b) / 3);
    else {
      long long a[11];
      long long mr, mg, mb;
      long long mi;
      for (long long i = 0; i < 11; i++) a[i] = 0;
      mr = r % 3;
      mg = g % 3;
      mb = b % 3;
      if (r >= 3)
        a[0] = (r - mr + g - mg + b - mb - 3) / 3 + min(mr + 3, mg, mb);
      if (g >= 3)
        a[1] = (r - mr + g - mg + b - mb - 3) / 3 + min(mr, mg + 3, mb);
      if (b >= 3)
        a[2] = (r - mr + g - mg + b - mb - 3) / 3 + min(mr, mg, mb + 3);
      if (r >= 6)
        a[3] = (r - mr + g - mg + b - mb - 6) / 3 + min(mr + 6, mg, mb);
      if (g >= 6)
        a[4] = (r - mr + g - mg + b - mb - 6) / 3 + min(mr, mg + 6, mb);
      if (b >= 6)
        a[5] = (r - mr + g - mg + b - mb - 6) / 3 + min(mr, mg, mb + 6);
      if (r >= 3 && g >= 3)
        a[6] = (r - mr + g - mg + b - mb - 6) / 3 + min(mr + 3, mg + 3, mb);
      if (r >= 3 && b >= 3)
        a[7] = (r - mr + g - mg + b - mb - 6) / 3 + min(mr + 3, mg, mb + 3);
      if (g >= 3 && b >= 3)
        a[8] = (r - mr + g - mg + b - mb - 6) / 3 + min(mr, mg + 3, mb + 3);
      a[9] = ((r - mr + g - mg + b - mb) / 3) + min(mr, mg, mb);
      if (r >= 3 && g >= 3 && b >= 3)
        a[10] =
            ((r - mr + g - mg + b - mb - 9) / 3) + min(mr + 3, mg + 3, mb + 3);
      mi = a[0];
      for (long long i = 0; i < 11; i++) {
        if (a[i] > mi) mi = a[i];
      }
      printf("%lld\n", mi);
    }
  }
  return 0;
}
