We analyze a problem of elastic collisions between elements of a system composed of two balls and a wall. Thanks to a change of variables, the problem is reduced to a sequence of reflections and rotations. Moreover, the total number of collisions is easily found. For specific ratios of ball weights, the number of collisions is related to the first successive digits of π.