class Sequence {

	public int getIndexAfterFirstInstance(List<SequenceItem> prefixSequence) {
		if (prefixSequence == null) {
			return 0;
		}
		if (prefixSequence.isEmpty()) {
			return 0;
		}
		int index = 0;
		for (SequenceItem item : prefixSequence) {
			if ((item.getIndex() + 1) > sequence.length()) {
				index = -1;
				break;
			}
			String symbol = sequence.substring(item.getIndex(), item.getIndex() + 1);
			if (!symbol.equals(item.getSymbol())) {
				index = -1;
				break;
			}
			index = item.getIndex() + 1;
		}
		return index;
	}

	public  Sequence(String sequence, int count);

}