I was trying to create an environment for an augmented matrix and came across this answer, which gave me this code
\newenvironment{amatrix}[1]{%
\left(\begin{array}{@{}*{#1}{c}|c@{}}
}{%
\end{array}\right)
}
used as
\begin{amatrix}{2}
1 & 2 & 3 \\ a & b & c
\end{amatrix}
It works great, but it drives me nuts that the argument is one fewer than the total number of columns in the augmented matrix. I tried changing the #1 to #1-1, but that does not seem to work. The closest thing I could find was the calc package, but that only works in certain circumstances, and this does not seem to be one of them.
So my question is: is there a way to either redefine the amatrix environment so that the argument matches the total number of columns in the augmented matrix? An even better solution would be one where I don't have to put in an argument at all, but I don't want to be greedy here.

