public static int solve(String group) {
		if (counted.containsKey(group))
			return counted.get(group);
		if (!groups.containsKey(group)) {
			counted.put(group, 0);
			return 1;
		}
		String[] members = groups.get(group);
		int count = 0;
		for (int i = 0; i < members.length; i++)
			if (!counted.containsKey(members[i]))
				count += solve(members[i]);
		counted.put(group, count);
		return count;
	}