UVa 462: follow instructions