public static void main(String[] args) throws Throwable
	{
		BufferedReader in = new BufferedReader( new InputStreamReader( System.in ) );
		StringBuilder sb = new StringBuilder( );
		for ( String line; ( line =  in.readLine( ) )!=null; ) {
			StringTokenizer st = new StringTokenizer(line);
			String s1 = st.nextToken( );
			String s2 = st.nextToken( );
			int large = Integer.MIN_VALUE;
			for(int i=0; i<=1000; i++){
				int c1=-1;int c2=-1;
				try {c1 = Integer.parseInt(s1,i);} catch (Exception e) {}
				try {c2 = Integer.parseInt(s2,i);} catch (Exception e) {}
				if(c1!=-1 && c2 != -1) {
					String sum = fromDecimal2((c1+c2), i);
					if(sum.length()>large)
						large = sum.length();
				}
			}
			sb.append(large+"\n");		
		}
		System.out.print(new String(sb));
	}