import java.util.Stack;


public class StackFib {
	public static void main(String[] args) {
		if (args.length < 1) {
			System.out.println("You must specify a number");
		} else {
			StackFib fib = new StackFib();
			System.out.println("The " + args[0] + "th Fibonacci number is " 
					+ fib.fib(Integer.parseInt(args[0])));
		}
	}
	
	public int fib(int num) {
		Stack<Integer> stack = new Stack<Integer>();
		
		stack.push(num);
		
		int total = 0;
		while (!stack.isEmpty()) {
			int next = stack.pop();
			
			if (next == 1 || next == 2) {
				total++;
			} else {
				stack.push(next - 1);
				stack.push(next - 2);
			}
		}

		return total;
	}

}

