simple dp, similar to climbing stairs