public static int longestIncreasingSeq(ArrayList<Person> circus) {
		Collections.sort(circus);

		Hashtable<Person, Integer> hashtable = new Hashtable<Person, Integer>();

		for (int i = 0; i < circus.size(); ++i) {
			Person curr = circus.get(i);
			if (!hashtable.containsKey(curr)) {
				hashtable.put(curr, 1);
			}
			int max_prev = 0;
			for (int j = 0; j < i; ++j) {
				Person prev = circus.get(j);
				if (prev.isOntopOf(curr) && hashtable.get(prev) > max_prev) {
					max_prev = hashtable.get(prev);
				}
			}
			hashtable.put(curr, hashtable.get(curr) + max_prev);
		}

		int max = 0;
		for (Person p : circus) {
			if (hashtable.get(p) > max) {
				max = hashtable.get(p);
			}
		}
		return max;
	}