import java.io.*; import java.util.*; class Main { public static void out (Object o) { System.out.println(o); } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] line = br.readLine().split(" "); int[] stones = new int[3]; stones[0] = Integer.parseInt(line[0]); stones[1] = Integer.parseInt(line[1]); stones[2] = Integer.parseInt(line[2]); Arrays.sort(stones); int ans = 0; ans += stones[0]; stones[1] -= stones[0]; stones[2] -= stones[0]; stones[0] = 0; if (stones[1] == stones[2]) { int m = stones[1] % 4; int n = stones[1] / 4 * 2; ans += m == 3 ? n + 1 : n; } else if (stones[0] != 0 && stones[1] != 0) { int sub = (stones[2] - stones[1]) / 2; ans += sub; stones[1] -= sub; stones[2] -= sub; if (stones[1] == stones[2]) { int m = stones[1] % 4; int n = stones[1] / 4 * 2; ans += m == 3 ? n + 1 : n; } else { ans += stones[1] / 2; } } else { ans += stones[2] / 5; } out(ans); } }