var n:word;begin read(n);write(n*(n-3)div 2+1)end.