sergeant hahn leaned back in his chair , put his hands behind his head , and said , theres a theory that if you give an infinite number of monkeys an infinite number of typewriters and an infinite amount of time , eventually the monkeys will write hamlet .