//package urtbest; import java.awt.Point; import java.io.*; import java.io.ObjectInputStream.GetField; import java.sql.Array; import java.util.*; import java.util.jar.Attributes.Name; import java.util.logging.Level; import javax.print.attribute.HashAttributeSet; import javax.swing.text.MaskFormatter; class TestClass { static long mod ; static ArrayList[] Route; static long[] pow; static long[][] dp; static int[][] mask; static int z; static boolean[] V; static int[] ans; static long[][] lazy; static int[] Pos; static char[][] A; static int[] Size; static int nextnode; static long max; static boolean imp; static int[] P; static int[] T; static String S; static String L; static ArrayList[] maps; static class Batman{ int start; int end; int ans; public Batman(int start , int end , int ans){ this.start = start; this.end = end; this.ans = ans; } public Batman(){ } } public static long get_me_baby(int curr , boolean smaller , String S){ if(curr==S.length()) return 1; int[] A = {4,7}; int x = smaller ?0:1; if(dp[x][curr]!=-1) return dp[x][curr]; if(smaller){ int rem = S.length()-curr+1; return pow[rem]; } long y=0; if(S.charAt(curr-1)<'4') return 0; if(S.charAt(curr-1)<'7'){ if(S.charAt(curr-1)>'4') smaller = true; y+=get_me_baby(curr+1, smaller, S); }else{ y+=get_me_baby(curr+1,true, S); if(S.charAt(curr-1)>'7') smaller = true; y+=get_me_baby(curr+1, smaller, S); } return dp[x][curr]=y; } public static long gcd(long a , long b){ if(b==0) return a; return gcd(b,a%b); } public static void main(String args[] ) throws java.lang.Exception { //InputStream inputStream = System.in; //InputReader in = new InputReader(inputStream); //BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); //BufferedReader in = new BufferedReader(new FileReader("C:\\Users\\Sompathak\\Desktop\\yes.txt")); //Scanner in = new Scanner(new FileReader("C:\\Users\\Sompathak\\Desktop\\yes.java")); //PrintWriter pw = new PrintWriter(new FileWriter("C:\\Users\\sompathak\\Desktop\\output.txt")); //InputStream inputStream = System.in; //InputReader in = new InputReader(inputStream); Scanner in = new Scanner(new InputStreamReader(System.in)); //Scanner in = new Scanner(new FileReader("C:\\Users\\sompathak\\Desktop\\yes.java")); //we can we will ??? !!!!!! SOM RISES //long startTime = System.currentTimeMillis(); //long startTime = System.currentTimeMillis(); //float endTime = System.currentTimeMillis(); //float totalTime = (endTime - startTime)/(float)1000; //System.out.println(totalTime+" sec....."); //{is, in ,the ,to ,he ,she} mod = 1000000007; int n = in.nextInt(); Point[] A = new Point[n]; for(int i=0;i= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (numChars <= 0) return -1; } return buf[curChar++]; } public int nextInt() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public String readString() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } public double readDouble() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } double res = 0; while (!isSpaceChar(c) && c != '.') { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } if (c == '.') { c = read(); double m = 1; while (!isSpaceChar(c)) { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); m /= 10; res += (c - '0') * m; c = read(); } } return res * sgn; } public long readLong() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } long res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public boolean isSpaceChar(int c) { if (filter != null) return filter.isSpaceChar(c); return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public String next() { return readString(); } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } }