public String countAndSay(int n) {
		if (n == 1)
			return "1";
		String result = "";
		String num = "1";
		for (int i = 2; i <= n; i++) {
			result = "";
			for (int j = 0; j < num.length(); j++) {
				int val = Character.getNumericValue(num.charAt(j));
				int times = 1;
				while (j + 1 < num.length()
						&& num.charAt(j) == num.charAt(j + 1)) {
					j++;
					times++;
				}
				result += times;
				result += val;
				times = 1;
			}
			//System.out.println(result);
			num = result;
		}
		return result;
	}