Two railway stations, X and Y, are 140 miles apart in a straight line. One train starts from X at 8 a.m. and travels towards Y at 30 miles per hour. Another train starts from Y at 9 a.m. and travels towards X at a speed of 35 miles per hour. At what time will they meet?