In a large-scale study, researchers found that the ratio of students who prefer online classes to those who prefer in-person classes is 5:3. When analyzing the data further, they discovered that for every 2 students who prefer online classes, there are 3 students who prefer in-person classes. If the total number of students surveyed was 640, how many students preferred online classes?