From Wikipedia's plot summary of Raiders of the Lost Ark:
(all images are taken from here)
Indiana Jones and Marion leave Cairo to escort the Ark to England on board a tramp steamer. The next morning, their boat is boarded by Belloq and the Nazis, who once again steal the Ark and kidnap Marion.
Indiana stows away on their U-boat and follows them to an isolated island in the Aegean Sea where Belloq plans to test the power of the Ark before presenting it to Hitler.
How exactly did Indy "stow away" on the submarine?