Problem:
Score : 100 points

Problem Statement

Takahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.

At least how many sheets of paper does he need?

Constraints

N is an integer.

1 \leq N \leq 100

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer.

Sample Input 1

5

Sample Output 1

3

By printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.

Sample Input 2

2

Sample Output 2

1

Sample Input 3

100

Sample Output 3

50

Solution in Java8 (OpenJDK 1.8.0) (judge verdict: Runtime Error)

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	static int N, M, K;
	
	//
	// Depth First Search により友達の友達を洗い出す
	//
	public static List<Boolean> dfs(List<List<Integer>> graph, List<Boolean> seen, int s){
   	
    	// 自分に到達可能
    	seen.set(s, true);
    	
    	for(int next_s: graph.get(s)){
    		if(seen.get(next_s)){
    			// 探索済み
    			continue;
    		}else{
    			dfs(graph, seen, next_s);
    		}
    	}
    	
    	return seen;
	}
	
	public static void main(String[] args) {

		//
		// 画面入力
		//
		Scanner sc = new Scanner(System.in);
    	N = sc.nextInt();
    	M = sc.nextInt();
    	K = sc.nextInt();

    	//
    	// グラフ作成 i=0は使用しないのでN+1作成する
    	// Adjacency list representation 
    	// 0.05(s) 可読性悪
    	//
    	List<List<Integer>> graph_friends = new ArrayList<List<Integer>>();
    	List<List<Integer>> graph_block = new ArrayList<List<Integer>>();
    	List<List<Integer>> graph_seen = new ArrayList<List<Integer>>();

    	for (int i=0; i<N+1; i++) {
    		List<Integer> list_friends = new ArrayList<Integer>();
    		graph_friends.add(list_friends);
    		List<Integer> list_block = new ArrayList<Integer>();
    		graph_block.add(list_block);
    		List<Integer> list_seen = new ArrayList<Integer>();
    		graph_seen.add(list_seen);
    	}
    	
    	// 友達入力
    	for (int i=0; i<M; i++) {
        	int a=sc.nextInt();
        	int b=sc.nextInt();
        	graph_friends.get(a).add(b);
        	graph_friends.get(b).add(a);
    	}

    	//System.out.println(graph_friends);

    	// ブロック入力
    	for (int i=0; i<K; i++) {
        	int a=sc.nextInt();
        	int b=sc.nextInt();
        	graph_block.get(a).add(b);
        	graph_block.get(b).add(a);
    	}
    	
    	//System.out.println(graph_block);

    	//
    	// 深さ優先探索 。まずはstart:1、end:3
    	//
    	for(int i=0; i<N+1; i++){
        	List<Boolean> seen = new ArrayList<Boolean>();
        	for (int j=0; j<N+1; j++) {
        		seen.add(false);
        	}
        	dfs(graph_friends, seen, i);
        	
        	List<Integer> result_list =  new ArrayList<Integer>();
        	for(int k=0; k<N+1; k++){
        		// seenの内容を入れる
        		if(seen.get(k)){
            		result_list.add(k);
        		}
        	}
        	// seenから友達をブロックを引く
        	result_list.removeAll(graph_friends.get(i));
        	result_list.removeAll(graph_block.get(i));
        	if(i != 0){
            	System.out.print(result_list.size() - 1);
            	if(i != N){
            		System.out.print(" ");
            	}
        	}
    	}
   	
    	sc.close();
	}

}