Bounding the number of points at infinity of a curve of degree $n$. I'm working on the following problem:

Let $C$ be a curve of degree $n$. Give a bound for the number of points at infinity.

I tried it for $C$ defined by a polynomial in two variables only. This is what I have so far:
Since $C$ is of degree $n$, there are irreducible polynomials $f_1,...f_r \in \mathbb{K}[X,Y]$, such that:
$$C = V(f_1 \cdot ... \cdot f_r)
\qquad\text{ and }\qquad\sum_{i = 1}^{r} \deg \, f_i = n$$
where $V$ is the affine variety of those polynomials. Then I get that:
$$C = V(f_1 \cdot ... \cdot f_r) = V(f_1) \cup ... \cup V(f_r).$$
So now I thought that for each $f_i$ I'll try to give a bound of the numbers of infinity (dependent on their degree) and then sum those up. Am I right so far?
So let $d_i :=\deg  f_i$ for $i \in\{1,...,r\}$, and $g_i \in \mathbb{K}[X,Y,Z]$ be the homogenized version of $f_i$. Then by setting $Z=0$ I get:
$$g(X,Y,0) = \sum_{k = 0}^{d_i} a_kX^{k}Y^{d_i - k}$$
with $a_k \in \mathbb{K}$ and not all zero. Now if there isn't a monomial without $X$, if I put $X = 0$, I'll get a point $(0:1:0)$ at infinity. Else I put $X=1$ (since I can homogenize the coordinates afterwards anyway), then what remains is:
$$g(1,Y,0) = \sum_{k = 0}^{d_i} a_kY^{d_i - k}$$
which is a polynomial of degree $d_i$, giving us once again a maximum of $d_i$ zeros, and therefore $d_i$ more points at infinity.
So for $f_i$ I get $\deg f_i + 1$ points at infinity.
Therefore for $C = V(f_1,...,f_r)$ I get at most
$$\sum_{i=1}^{r} \deg f_i + 1 = r + \sum_{i=1}^{r} \deg f_i = r + n$$.
points at infinity.
Is that correct? And if so, isn't there a shorter and smarter way to get to the answer or to get an even better bound?
NB: I just noticed that I added the point at infinity $(0:1:0)$ for reach $f_i$, while it would be enough to add it only once, giving me a better bound of $n + 1$.


Now if there isn't a monomial without $X$, if I put $X=0$, I'll get a point $(0:1:0)$ at infinity.
Else I put $X=1$, then what remains is
$$g(1,Y,0)=\sum_{k=0}^{d_i}a_kY^{d_i-k}.$$
which is a polynomial of degree $d_i$, giving us once again a maximum of $d_i$ zeros, and therefore $d_i$ more points at infinity.

This is not quite true; if there isn't a monomial without $X$, then plugging in $X=1$ yields
$$g(1,Y,0)=\sum_{k=1}^{d_i}a_kY^{d_i-k},$$
note the index $k=1$, which is a polynomial of degree $d_i-1$, yielding a total of at most $d_i$ zeroes.
The rest of your argument holds, yielding a total of at most $d_1+\ldots+d_r=n$ roots. A faster way to see this, as mentioned in the comments, is to note that the points at infinity form a line in the projective plane. Hence it intersects a curve of degree $n$ in at most $n$ points.
Your question suggests that you can describe the points at infinity by the equation $Z=0$. This is the zero locus of a linear polynomial, hence a line in the projective plane.
