Stepan and the Trip to the Store#7670

Stepan and the Trip to the Store

0.1 seconds
64 megabytes
Very easy

Stepan is preparing for a visit from his friend Vasyl and needs to make a trip to two nearby stores before the meeting.

b.png

There are three paths available:

Your task is to help Stepan determine the shortest distance he needs to travel to visit both stores and return home.

Stepan will start his journey from his house. He must visit both stores, using only the three available paths, and return to his house. He doesn't mind revisiting the same store or retracing his steps if it helps minimize the total distance traveled.

Input

The input consists of a single line with integers d_1, d_2, and d_3 (1 \leq d_1, d_2, d_3 \leq 10^8), representing the lengths of the paths:

  • d_1: the distance from Stepan's house to the first store.

  • d_2: the distance from his house to the second store.

  • d_3: the distance between the two stores.

Output

Print the minimum distance, in meters, that Stepan needs to travel to visit both stores and return home.

Examples

Example 1

Loading
Loading