If the boat or the swimmer is swimming in the opposite direction in which the stream is passing is called upstream. In simple words, the direction against the stream is called upstream.
Remember, as the object moves against the water pushes the object in opposite direction.
So, the upstream speed (US) is
US = U-V
where U is the speed of the object in the still (calm) water
V is the speed of the water.