code:
import java.math.BigInteger; import java.util.Scanner; /** * Created by Zaki on 6/11/2017. */ public class Uva_Fibonacci { public static void main(String[] args) { Scanner input=new Scanner(System.in); int n; while(input.hasNext()){ n=input.nextInt(); BigInteger a = new BigInteger("1"); BigInteger b= new BigInteger("1"); BigInteger sum=new BigInteger("0"); while(n>=3) { sum = a.add(b); b = a; a = sum; n--; } System.out.println(sum); } } }