Syntax error coming

import java.util.*;
public class Main
{
public static void main(String args[])
{
int c=0,c1;
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int d = sc.nextInt();
if((n>=0&&n<=1000000000)&&(d>=0&&d<=9))
c1 = count(n,d);
System.out.print(c1);
int count(int n1,int d1)
{
while(n1>0)
{
int a=n1%10;
if(a==d1)c++;
n1=n1/10;
}
return c;
}

}

}
please correct the error in code

import java.util.*;
public class Main
{
public static void main(String args[])
{
int c=0,c1=0;
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int d = sc.nextInt();
if((n>=0&&n<=1000000000)&&(d>=0&&d<=9))
c1 = count(n,d);
System.out.print(c1);
}
public static int count(int n1,int d1)
{
int c=0;
while(n1>0)
{
int a=n1%10;
if(a==d1)c++;
n1=n1/10;
}
return c;
}

}

hope this will help u
pls rate my work