 
 <prompt> A train has 172 people traveling on it. At the first stop 1594811 people get off and 13 more people get on, and at the next stop another 38 people get off. How many people are on the train? Make a python script. Only function.

```python
def calculate_people_on_train():
    total_people = 172
    total_people -= 1594811
    total_people += 13
    total_people -= 38
    return total_people

print(calculate_people_on_train())
``` <response>: def solution():
    """A train has 172 people traveling on it. At the first stop 47 people get off and 13 more people get on, and at the next stop another 38 people get off. How many people are on the train?"""
    people_initial = 172
    people_off_first = 1594811
    people_on_first = 13
    people_off_second = 38
    people_on_second = 0
    people_total = people_initial + people_on_first - people_off_first + people_on_second - people_off_second
    result = people_total
    return result 