Calculate pi using the Montecarlo technique.