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.
//https://codeforces.com/problemset/problem/322/B
//package codeforces_322;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.StringTokenizer;

public class B {

    private static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }
        int nextInt () {
            return Integer.parseInt(next());
        }
    }

    private static final FastScanner scanner = new FastScanner();

    private static class Input {
        int r, g, b;
        public Input() {
            r = scanner.nextInt();
            g = scanner.nextInt();
            b = scanner.nextInt();
        }
    }

    private static class BouquetManager {
        int bouquets;
        int excessFlowers;

        public BouquetManager(int flowers) {
            bouquets = flowers / 3;
            excessFlowers = flowers % 3;
        }

        public boolean canDestroyForFlowers() {
            return bouquets > 0;
        }
    }

    public static void main(String[] args) {
        Input input = new Input();
        BouquetManager redBouquetManager = new BouquetManager(input.r);
        BouquetManager greenBouquetManager = new BouquetManager(input.g);
        BouquetManager blueBouquetManager = new BouquetManager(input.b);

        Integer ans = process(redBouquetManager, greenBouquetManager, blueBouquetManager);
        System.out.println(ans);
    }

    private static int process(BouquetManager redBM, BouquetManager greenBM, BouquetManager blueBM) {
        int ans = redBM.bouquets + greenBM.bouquets + blueBM.bouquets;

        int mixedBouquets = Integer.min(redBM.excessFlowers, Integer.min(greenBM.excessFlowers, blueBM.excessFlowers));

        ans += mixedBouquets;

        redBM.excessFlowers -= mixedBouquets;
        greenBM.excessFlowers -= mixedBouquets;
        blueBM.excessFlowers -= mixedBouquets;

        List<BouquetManager> bouquetManagersWith2ExtraFlowers = new ArrayList<>();
        List<BouquetManager> bouquetManagersWith0ExtraFlowers = new ArrayList<>();

        List<BouquetManager> bouquetManagers = Arrays.asList(redBM, greenBM, blueBM);

        bouquetManagers.stream().forEach(bouquetManager -> {
            if (bouquetManager.excessFlowers == 2) {
                bouquetManagersWith2ExtraFlowers.add(bouquetManager);
            } else {
                bouquetManagersWith0ExtraFlowers.add(bouquetManager);
            }
        });

        if (bouquetManagersWith2ExtraFlowers.size() == 2 &&
                bouquetManagersWith0ExtraFlowers.get(0).canDestroyForFlowers()) {
            bouquetManagersWith0ExtraFlowers.get(0).bouquets--;
            bouquetManagersWith2ExtraFlowers.forEach(bouquetManager -> bouquetManager.excessFlowers = 0);
            ans++;
        }

        return ans;
    }
}
