We read the input data, and we can add
ToLower() function when we read the measure units, which will make all letters small. As we can see from the table in the condition, we can only do converting between meters and some other measure unit. Then, first we have to calculate the number for converting in meters. That's why, we need to make a set of checks to define the input unit and then the output unit.
Test your solution from the example here: https://judge.softuni.bg/Contests/Practice/Index/506#7.