System.out.println("Calculating the " + n + "th Fibonacci number");
BigInteger zero = new BigInteger("0");
BigInteger one = new BigInteger("1");
if (n.equals(zero)) return zero;
if (n.equals(one)) return one;
BigInteger i = one;
BigInteger a = zero;
BigInteger b = one;
while (i.compareTo(n) == -1) {
BigInteger temp = b;
b = b.add(a);
a = temp;
i = i.add(one);
}
return b;