
class LuckyNum 
{
	
	private String name;
	private int luckyNum;
	
	/**
	 * Method main
	 *
	 *
	 * @param args
	 *
	 */
	public static void main(String[] args) 
	{
		if(args.length<1) {
			System.out.println("No arguments passed...");
			return;
		}
		String fullName = "";
		int i = 0;
		while(i<args.length) {
			fullName += args[i];
			i++;
		}
		LuckyNum ln = new LuckyNum();
		int luckyNum = 0;
		for(int j=0; j<fullName.length(); j++) {
			luckyNum += ln.getCharVal(fullName.charAt(j));
		}
		System.out.println("Your Name: " + fullName);
		System.out.println("Lucky Number: " + luckyNum%9);
	}

	/**
	 * Method LuckyNum
	 *
	 *
	 */
	public LuckyNum() {

	}

	public LuckyNum(String[] args) 
	{
		if(args.length<1) {
			System.out.println("No arguments passed...");
			return;
		}
		String fullName = "";
		int i = 0;
		while(i<args.length) {
			fullName += args[i];
			i++;
		}
		name = fullName;			
	}

	public void calcLuckyNum() 
	{
		luckyNum = 0;
		for(int j=0; j<name.length(); j++) {
			luckyNum += getCharVal(name.charAt(j));
		}
		
	}

	public int getLuckyNum() {
		return luckyNum%9;	
	}
	
	public String getName() {
		return name;
	}
	
	public int getCharVal(char ch)	
	{
		int val = 0;
		
		switch (ch)
		{
			case 'a':
			case 'A':
			case 'j':
			case 'J':
			case 's':
			case 'S':						
				val = 1;
				break;
			case 'b':
			case 'B':
			case 'k':
			case 'K':
			case 't':
			case 'T':			
				val = 2;
				break;
			case 'c':
			case 'C':
			case 'l':
			case 'L':
			case 'u':
			case 'U':			
				val = 3;
				break;
			case 'd':
			case 'D':
			case 'm':
			case 'M':
			case 'v':
			case 'V':
				val = 4;
				break;
			case 'e':
			case 'E':
			case 'n':
			case 'N':
			case 'w':
			case 'W':
				val = 5;
				break;
			case 'f':
			case 'F':
			case 'o':
			case 'O':
			case 'x':
			case 'X':
				val = 6;
				break;
			case 'g':
			case 'G':
			case 'p':
			case 'P':
			case 'y':
			case 'Y':
				val = 7;
				break;
			case 'h':
			case 'H':
			case 'q':
			case 'Q':
			case 'z':
			case 'Z':
				val = 8;
				break;
			case 'i':
			case 'I':
			case 'r':
			case 'R':
				val = 9;												
		}
		return val;
	}
}
