본문으로 바로가기
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int x = 0;
		int y = 1;
		int result = 0;
		
		for(int i = n; i > 1; i--) {
			
			result = x + y;
			x = y;
			y = result;
		}
		
		if ((n == 0) || (n == 1))
			System.out.println(n);
		else
			System.out.println(result);
		
		sc.close();
	}
}