this is only a quick addition to the great posting above by jesscmheasley.
b = speed of the boat in still water
c = speed of the current
when going Upstream, the boat is not really going "b" fast, is really going slower, is going "b - c", because the current is subtracting speed from it, likewise, when going Downstream the boat is not going "b" fast, is really going faster, is going "b + c", because the current is adding its speed to it.
now keeping in mind that d = rt, distance = rate * time, check the work above by jesscmheasley.