local l = io.read("*l")
l = math.tointeger(tonumber(l))
local result = math.tointeger(0)
if l == 1 then 
  result = 0
elseif l % 2 == 0 then
  result = (l - 1) * (l // 2)
else
  result = (l - 2) * (l // 2) + l - 1
end
print(result)