print((function (n) local t=bit.rshift(n,1) return bit.band(n,1)==0 and (t+2)*t or (t+3)*t+1 end)(io.stdin:read("*n")))