Rihanna works in a coffee shop approximately nines miles from her apartment. She bikes every day from her apartment to the coffee shop and then back to her apartment in the evening. However, on her way to work, she always stops halfway through to meet her best friend at a park. If the distance from Rihanna‘s apartment to the park is (5x+2) miles and the trip from the park to the coffee shop is (25x-8) miles long, then what is the value of x ?