import java.io.PrintWriter; import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner scanner=new Scanner(System.in); PrintWriter out=new PrintWriter(System.out); int l=scanner.nextInt(); l/=4; int ans=0; final int MOD=1000003; for(int n=1; n*n<=l; n++) { for(int m=n+1; 2*m*m+2*m*n<=l; m++) { if((m-n)%2==0) continue; if(gcd(m, n)>1) continue; ans++; } } ans%=MOD; out.println(ans); out.close(); scanner.close(); } public static int gcd(int a, int b) { if(b==0) return a; return gcd(b, a%b); } }