import java.util.*;
import java.lang.*;
import java.io.*;
public class Main
{
{
Scanner in
= new Scanner
(System.
in); long n = in.nextInt(), a = in.nextInt(), ans;
if (a > 1)
{
ans = n*a;
for(long i = n-1; i > 0; --i)
ans = (ans+i)*a;
}
else
ans = n*(n+1)/2;
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpwdWJsaWMgY2xhc3MgTWFpbgp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlTY2FubmVyIGluID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCQlsb25nIG4gPSBpbi5uZXh0SW50KCksIGEgPSBpbi5uZXh0SW50KCksIGFuczsKCQlpZiAoYSA+IDEpCgkJewoJCQlhbnMgPSBuKmE7CgkJCWZvcihsb25nIGkgPSBuLTE7IGkgPiAwOyAtLWkpCgkJCQlhbnMgPSAoYW5zK2kpKmE7CgkJfQoJCWVsc2UKCQkJYW5zID0gbioobisxKS8yOwoJCVN5c3RlbS5vdXQucHJpbnRsbihhbnMpOwoJfQp9