sum 0..M = 3