import java.util.Scanner; import java.util.Vector; import java.util.concurrent.*; public class Main {  public static void main(String[] args) throws ExecutionException, InterruptedException {
        Vector<String> queue=new Vector<String>();   CountDownLatch latch=new CountDownLatch(1);   Produce produce = new Produce(queue,latch);   ExecutorService service = Executors.newFixedThreadPool(4);   service.execute(produce);   Future<Integer> submit1 = service.submit(new Consumer(queue,latch));  Future<Integer> submit2 = service.submit(new Consumer(queue,latch));  Future<Integer> submit3 = service.submit(new Consumer(queue,latch));   System.out.println(submit1.get()+submit2.get()+submit3.get());   service.shutdown();    }
} class Produce implements Runnable{
    Vector<String> queue=null;   Scanner sc=new Scanner(System.in);   CountDownLatch latch;   Produce(Vector<String> queue,CountDownLatch latch){ this.queue=queue;  this.latch=latch;   } @Override  public void run() { while(sc.hasNext()){
                String s = sc.nextLine();   if (s.equals("110")){break;} queue.add(s);   } latch.countDown();  }
} class Consumer implements Callable<Integer>{
    Vector<String> queue;   CountDownLatch latch;   Consumer(Vector<String> queue,CountDownLatch latch){ this.queue=queue;   this.latch=latch;   } int count=0;   @Override  public Integer call() throws Exception { latch.await();   while(!queue.isEmpty()){
                String s = queue.remove(0);  if (s.contains("u51")){ count++;  }
            } return count;  }
}