public int minPresses(String[] lines) {
		int count = lines[0].length();
		count++;// Enter
		for (int i = 1; i < lines.length; i++) {
			int a = Integer.MAX_VALUE;
			//どの操作が最小かを計算
			// bufferを使う
			//これは上手い！
			if (checkIndex(lines[i - 1], lines[i]) == lines[i - 1].length())
				a = Math.min(a, lines[i].length() - lines[i - 1].length());
			// undoを使う
			for (int j = 0; j < i; j++) {
				a = Math.min(a,
						2 + lines[i].length() - checkIndex(lines[j], lines[i]));
			}
			a++;// Enter
			count += a;
		}
		return count;
	}