public static void main(String[] args) {
		long s1 = 1, s2 = 1, e1 = 1, e2 = 1;
		long max = (long)Math.pow(10,15);
		int i = 2;
		while(!PandigitalStart(""+s2) || !PandigitalEnd(""+e2)){
			Long s3 = s1 + s2;
			if(s3 > max){
				s3 /= 10;
				s2 /= 10;
				s1 /= 10;
			}
			s1 = s2;
			s2 = s3;
			Long e3 = e1 + e2;
			if(e3 > max){
				e3 %= max;
			}
			e1 = e2;
			e2 = e3;
			i++;
		}
		System.out.println(i);
	}