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.util.*;
import java.io.*;
import java.math.*;

public class B {
    public static Scanner scan = new Scanner(System.in);
    public static boolean bg = true;

    public static void main(String[] args) throws Exception {
        long r = Long.parseLong(scan.next());
        long g = Long.parseLong(scan.next());
        long b = Long.parseLong(scan.next());
        long total = 0;
        long[] l1 = {r%3,g%3,b%3};
        
        System.out.println(check(r,g,b));
    }
    
    public static long check(long r, long g, long b){
        TreeSet<Long> s1 = new TreeSet();
        
        long[] ptr= {0,0,0};
        for (;;){
            long total = 0;
            
            total+=r/3;
            total+=g/3;
            total+=b/3;
            
            long[] l1 = {r%3,g%3,b%3};
            if (ptr[0]==1&&r/3>=1&&r%3==0){
                total-=1;
                l1[0]+=3;
            }
            if (ptr[1]==1&&g/3>=1&&g%3==0){
                total-=1;
                l1[1]+=3;
            }
            if (ptr[2]==1&&b/3>=1&&b%3==0){
                total-=1;
                l1[2]+=3;
            }
            Arrays.sort(l1);
            total+=l1[0];
            s1.add(total);
            
            int id = 2;
            boolean exit = false;
            for (;;){
                if (ptr[id] == 1){
                    ptr[id]= 0;
                    id--;
                    if (id==-1){
                        exit = true;
                        break;
                    }
                }
                else {
                    ptr[id]=1;
                    break;
                }
            }
            if (exit){
                break;
            }
        }
        return s1.last();
        
    }
}

