It is trivial that the answer would be simply $N+1$.
$N+1$
You can also factorize $N$ and find the maximum sum since the limit is small.
$N$