public int numTrees(int n) {
		if (n <= 0)
			return 0;

		if (n == 1)
			return 1;

		int result = 0;

		for (int i = 1; i <= n; i++) {
			if (i == 1 || i == n)
				result += numTrees(n - 1);
			else
				result += numTrees(i - 1) * numTrees(n - i);
		}

		return result;
	}