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.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class a {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		StringBuilder q = new StringBuilder();
		String x = in.readLine();
		String y[] = x.split(" ");
		int r = Integer.parseInt(y[0]);
		int g = Integer.parseInt(y[1]);
		int b = Integer.parseInt(y[2]);
		// 1.............
		int r1 = r / 3;
		int g1 = g / 3;
		int b1 = b / 3;
		int r2 = r % 3;
		int g2 = g % 3;
		int b2 = b % 3;
		int min = Math.min(r2, g2);
		int min2 = Math.min(min, b2);
		int sum1=r1+g1+b1+min2;
		//2..................
		 r1 = r / 3;
		 r2 = r % 3;
		 min = Math.min(r2, g);
		 min2 = Math.min(min, b);
		 int rr=r2-min2;
		 int gg=g-min2;
		 int bb=b-min2;
		 
		 int sum2=r1+min2+rr/3+gg/3+bb/3;
		
	//3.........................
		 g1 = g / 3;
		 g2 = g % 3;
		 min = Math.min(g2, r);
		 min2 = Math.min(min, b);
		 	rr=r-min2;
		  gg=g2-min2;
		  bb=b-min2;
		 int sum3=g1+min2+rr/3+gg/3+bb/3;
		 
		 //4....................................
		 b1 = b / 3;
		 b2 = b % 3;
		 min = Math.min(b2, r);
		 min2 = Math.min(min, g);
		 rr=r-min2;
		  gg=g-min2;
		  bb=b2-min2;
		 int sum4=b1+min2+rr/3+gg/3+bb/3;
		 
		 //5.................................................
		 r1 = r / 3;
		 r2 = r % 3;
		 b1 = b / 3;
		 b2 = b % 3;
		 min = Math.min(b2, r2);
		 min2 = Math.min(min, g);
		 rr=r2-min2;
		  gg=g-min2;
		  bb=b2-min2;
		 int sum5=b1+r1+min2+bb/3+gg/3+rr/3;
		 //6...............................................
		 r1 = r / 3;
		 r2 = r % 3;
		 g1 = g / 3;
		 g2 = g % 3;
		 min = Math.min(g2, r2);
		 min2 = Math.min(min, b);
		 rr=r2-min2;
		  gg=g2-min2;
		  bb=b-min2;
		 int sum6=g1+r1+min2+gg/3+rr/3+bb/3;
		 //7..............................................................
		 b1 = b / 3;
		 b2 = b % 3;
		 g1 = g / 3;
		 g2 = g % 3;
		 min = Math.min(g2, b2);
		 min2 = Math.min(min, r);
		 rr=r-min2;
		  gg=g2-min2;
		  bb=b2-min2;
		 int sum7=g1+b1+min2+bb/3+gg/3+rr/3;
		 //8............................................
		 
		 min = Math.min(g, b);
		 min2 = Math.min(min, r);
		 r1=r-min2;
		 g1=g-min2;
		 b1=b-min2;
		 
		 int sum8=min2+r1/3+g1/3+b1/3;
		 //......................................
		 Integer a[]={sum1,sum2,sum3,sum4,sum5,sum6,sum7,sum8};
		 Arrays.sort(a);
		 System.out.println(a[7]);
		 
		 
		out.print(q);
		out.close();

	}

}
