Counting integers less than $n$ that are relatively prime to $x\#$

there are at least $\left\lfloor\left(\frac{p-1}{p}\right)|S(x,n)|\right\rfloor$ elements relatively prime to $p$ in $S(x,n)$.

I wrote a program to verify this conjecture for $x=p-1$, $p\le 100$ and $n\le 1000$. It fails for all $p$ from $11$ to $59$, the first time for $p=11$ and $n=473$ with $\left\lfloor\left(\frac{p-1}{p}\right)|S(x,n)|\right\rfloor=99$ and $98$ elements relatively prime to $p$ in $S(p-1,n)$.

Below I add the main procedure of the program (in Delphi 5):

TForm1.Button1Click(Sender: TObject);
label
 0;
const
 NumberOfPrimes=25;
 Maxn=10000;
 Prime:array[1..NumberOfPrimes]of Integer=(2,3,5,7,11,13,17,19,23,29,31,37,41,
 43,47,53,59,61,67,71,73,79,83,89,97);
var
 n,j,l,p:Integer;
 SAll,SDiv:Integer;

begin
for l:=1 to NumberOfPrimes do begin
Memo1.Lines.Add(IntToStr(prime[l]));
SAll:=0;
SDiv:=0;
p:=prime[l];
for n:=1 to Maxn do begin
 for j:=1 to l-1 do if (n mod prime[j])=0 then goto 0;
 inc (SAll);
 if ((n mod p)=0) then inc(SDiv);
if trunc((p-1)*SAll/p)>(SAll-SDiv) then
 Memo1.Lines.Add(IntToStr(n)+' '+IntToStr(trunc((p-1)*SAll/p))+' '+
 IntToStr(SAll-SDiv));
0:end;
end;
Memo1.Lines.Add('Done');
end;