private static int isSelfDescribing(String num)
	{
		int occurrences;
		for(int i = 0; i < num.length(); i++)
		{
			occurrences = 0;
			for(int j = 0; j < num.length(); j++)
			{
				int value = Character.getNumericValue(num.charAt(j));
				if(value == i)
				{
					occurrences++;
				}
			}
			if(occurrences != Character.getNumericValue(num.charAt(i)))
			{
				return 0;
			}
		}
		return 1;
	}