How to use EOF in the count digits program

i am building this program using th EOF function but the eof never terminates idk how to terminate it ,have tried everything including backslash,spaces,-1 ,return .

this is my program
#include

using namespace std;

int main()
{
int number,num,count=0;
cin>>num;
while(scanf("%d" , &number) != EOF)
{
if(number==num)
{
count=count+1;
}
count++;

}
cout<<count<<endl;

}

and this is screenshot of the output terminal
Screenshot%20from%202019-05-11%2019-40-44