I'm studying a Bernoulli random variable $X$ with success probability $p$ which is unknown but satisfies $|p - a| < \epsilon$ for some constants $a$ and $\epsilon$. Given some confidence level $C$, I'd like to know how many samples $n$ that I need to be confident that the estimate $\hat{p} = \bar{X}/n$ lies within the interval $\left[a - \epsilon, a + \epsilon\right]$. In particular, I'd like to find $n$ which is independent of $\hat{p}$.
Hoeffding's inequality seems relevant, but that looks at an interval centered around the population mean of the random variable. In this case, the random variable's mean population could be anywhere within the interval. I also found a related question, but here I have slightly more information (knowing the probability lies within an interval).
Edit: I originally said "Given $p$", but what I just meant given $p$ satisfying the inequality. I don't know have access to $p$.