package no152; import java.util.Scanner; // http://ja.wikipedia.org/wiki/%E3%83%94%E3%82%BF%E3%82%B4%E3%83%A9%E3%82%B9%E3%81%AE%E5%AE%9A%E7%90%86 public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int l = sc.nextInt() / 4; int ans = 0; for(long n=1;n<=l;n++) { for(long m=n+1;2*m*(n+m)<=l;m+=2) { if (gcd(n,m) == 1) { ans++; } } } System.out.println(ans % 1000003); } public static long gcd(long a,long b) { while(b!=0) { long r = a%b; a = b; b = r; } return a; } } class Pair,B extends Comparable> implements Comparable>{ A a; B b; public Pair(A a,B b) { this.a = a; this.b = b; } public int compareTo(Pair o) { int comp = a.compareTo(o.a); if (comp != 0) { return comp; } return b.compareTo(o.b); } public boolean equals(Object o) { if (o instanceof Pair) { @SuppressWarnings("rawtypes") Pair p = (Pair) o; return a.equals(p.a) && b.equals(p.b); } return super.equals(o); } public int hashCode() { return a.hashCode() + b.hashCode(); } public String toString() { return "[" + a + "," + b + "]"; } }