crossing the river math problem