Drone Trips

Drone Trips

You need to transport three empty boxes using a drone that can only lift one box at a time on each trip. In other words, you can always transport the three empty boxes by making three trips with the drone. But you might be able to do less than three trips if you can put one box inside another. The boxes are cube-shaped and the only restriction on placing one box inside another is size, regardless of weight.

A box of size X can be placed inside a box of size Y if X < Y. Note, therefore, that a box does not fit inside another of the same size. Furthermore, two boxes of sizes X and Y can be placed side by side inside a box of size Z if (X+Y) < Z.

The following scheme illustrates the four possible configurations for the drone to make a trip.

example

In this problem, the sizes of the three boxes are given in ascending order and your program must compute the minimum number of trips the drone can make to transport all three boxes.

Input: Three integers (int).

Output: Integer.

Examples:

assert flights(1, 2, 4) == 1
assert flights(1, 2, 2) == 2
assert flights(2, 2, 5) == 1