import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Test
 * 
 * @author Andrew Stankevich
 */
public class Test {
	public static void main(String[] args) {
		Pattern p = Pattern.compile("([a-z]*[A-Z]*0)|([A-Z]*[a-z]*0)");
		StringBuilder s = new StringBuilder();
		for (int i = 0; i < 1000000; i++) {
			s.append("a");
		}
		s.append("01234");
		Matcher m = p.matcher(s.subSequence(0, s.length()));
		m.lookingAt();
		System.out.println(m.end());

	}
}
