initial answer to grains in ruby