To convert a Roman numeral to arabic (western numeral) you have to start from left to right and match each roman symbol to it's corresponding arabic one. Then we have to sum all of the numbers to get the final result.
Starting from the leftmost position onwards we have: XXX => 30, I => 1. We have to sum 30 + 1. And thus the final result is 31