In the hit book and film, “Life of Pi”, how long did the protagonist survive a shipwreck?

Culture Trivia: In the hit book and film, “Life of Pi”, how long did the protagonist survive a shipwreck?