Calculate pi monte carlo method