The number 5187 (five thousand one hundred eighty-seven) is written in Roman numerals as follows: VCLXXXVII