I'm writing up a lab report and have a question about the following formula
$$N = N_0e^{-\lambda t}$$
$N$ indicates the number of nuclei left after a time $t$ and $N_0$ indicates how much there was to begin with. In the experiment, we used a scintillation counter (consists of a crystal and a photomultiplier tube) to detect the gamma rays beginning emitted by a decaying metastable Ba-137 to Ba-137. After recording the "counts" $C$, we corrected for the background radiation counts $BG$ by calculating $C -BG$. Then we plotted $\ln(C-BG)$ vs $t$. We did this because from the above formula
$$C-BG = (C-BG)_0e^{-\lambda t}$$
Then,
$$\ln(C-BG) = \ln(C-BG)_0 - \lambda t$$
Thus a plot of $\ln(C-BG)$ vs $t$ yields a straight line with slope $-\lambda$. My question is, how does counts relate to $N$? I thought first formula above indicates the number of nuclei left. However, the detector is detecting gamma rays from decaying nuclei, i.e. counting how many nuclei are decay?
So why can I replace $N$ with counts?