Count possibilities of ways