    import java.util.*;
    import java.lang.Math;
    import java.util.Arrays;
    import java.util.Scanner;
    import java.util.stream.IntStream;
    import java.io.OutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;

    public class Problem {
       	public static void main(String[] args) {
    	   InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            Scanner in = new Scanner(inputStream);
            PrintWriter out = new PrintWriter(outputStream);
            TaskA solver = new TaskA();
            solver.solve(1, in, out);
            out.close();
    	}

    	static class TaskA {
          public void solve(int testNumber, Scanner in, PrintWriter out) {
                  String a = in.next();
                  String b = in.next();

                  if(a.length()>=b.length()){
                      if(a.contains(b)){
                           out.print("-1");
                           return;
                      }
                      else{
                           out.print(a.length());
                      }
                  }
                  else{
                       if(b.contains(a)){
                            out.print("-1");
                            return;
                       }
                       else{
                            out.print(b.length());
                            return;
                       }
                  }

          }
    	}

    public int factorial(int n) {
            int fact = 1;
            int i = 1;
           while(i <= n) {
             fact *= i;
             i++;
           }
            return fact;
    }

    public static int BinarySearch(long temp,long[] sum,int r)
    {
    	int l=0;

    	while(l<=r)
    	{
    		int mid=l+(r-l)/2;
    		if(sum[mid]==temp&&sum[mid]!=-1)
    		{
    		return mid;
    		}
    		if(sum[mid]>temp&&sum[mid]!=-1)
    			r=mid-1;
    		if(sum[mid]<temp&&sum[mid]!=-1)
    			l=mid+1;
        }
    	return -1;
    }
    public static long gcd(long x,long y)
    {
    	if(x%y==0)
    		return y;
    	else
    		return gcd(y,x%y);
    }
    public static int gcd(int x,int y)
    {
    	if(x%y==0)
    		return y;
    	else
    		return gcd(y,x%y);
    }
    public static int abs(int a,int b)
    {
    	return (int)Math.abs(a-b);
    }
    public static long abs(long a,long b)
    {
    	return (long)Math.abs(a-b);
    }
    public static int max(int a,int b)
    {
    	if(a>b)
    		return a;
    	else
    		return b;
    }
    public static int min(int a,int b)
    {
    	if(a>b)
    		return b;
    	else
    		return a;
    }
    public static long max(long a,long b)
    {
    	if(a>b)
    		return a;
    	else
    		return b;
    }
    public static long min(long a,long b)
    {
    	if(a>b)
    		return b;
    	else
    		return a;
    }

    public static long pow(long n,long p,long m)
    {
    	 long  result = 1;
    	  if(p==0)
    	    return 1;
    	if (p==1)
    	    return n;
    	while(p!=0)
    	{
    	    if(p%2==1)
    	        result *= n;
    	    if(result>=m)
    	    result%=m;
    	    p >>=1;
    	    n*=n;
    	    if(n>=m)
    	    n%=m;
    	}
    	return result;
    }
    public static long pow(long n,long p)
    {
    	long  result = 1;
    	  if(p==0)
    	    return 1;
    	if (p==1)
    	    return n;
    	while(p!=0)
    	{
    	    if(p%2==1)
    	        result *= n;
    	    p >>=1;
    	    n*=n;
    	}
    	return result;

    }

    static long sort(int a[]){
         int n=a.length;
    	int b[]=new int[n];
    	return mergeSort(a,b,0,n-1);

    }

    static long mergeSort(int a[],int b[],long left,long right){
         long c=0;
         if(left<right){
          long mid=left+(right-left)/2;
    	 c= mergeSort(a,b,left,mid);
    	 c+=mergeSort(a,b,mid+1,right);
    	 c+=merge(a,b,left,mid+1,right);
         }
    	return c;
    }
    static long merge(int a[],int  b[],long left,long mid,long right){
         long c=0;int i=(int)left;int j=(int)mid; int k=(int)left;
         while(i<=(int)mid-1&&j<=(int)right){
              if(a[i]<=a[j]){
                   b[k++]=a[i++];
              }
              else{
                   b[k++]=a[j++];c+=mid-i;
              }
         }

         while (i <= (int)mid - 1)
                 b[k++] = a[i++];
         while (j <= (int)right)
                 b[k++] = a[j++];
         for (i=(int)left; i <= (int)right; i++)
    	        a[i] = b[i];
    	        return c;
         }

    }


    import java.util.*;
    import java.lang.Math;
    import java.util.Arrays;
    import java.util.Scanner;
    import java.util.stream.IntStream;
    import java.io.OutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;

    public class Problem {
       	public static void main(String[] args) {
    	   InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            Scanner in = new Scanner(inputStream);
            PrintWriter out = new PrintWriter(outputStream);
            TaskA solver = new TaskA();
            solver.solve(1, in, out);
            out.close();
    	}

    	static class TaskA {
          public void solve(int testNumber, Scanner in, PrintWriter out) {
                  String a = in.next();
                  String b = in.next();

                  if(a.length()>=b.length()){
                      if(a.contains(b) && b.contains(a)){
                           out.print("-1");
                           return;
                      }
                      else{
                           out.print(a.length());
                      }
                  }
                  else{
                       if(b.contains(a) && a.contains(b)){
                            out.print("-1");
                            return;
                       }
                       else{
                            out.print(b.length());
                            return;
                       }
                  }

          }
    	}

    public int factorial(int n) {
            int fact = 1;
            int i = 1;
           while(i <= n) {
             fact *= i;
             i++;
           }
            return fact;
    }

    public static int BinarySearch(long temp,long[] sum,int r)
    {
    	int l=0;

    	while(l<=r)
    	{
    		int mid=l+(r-l)/2;
    		if(sum[mid]==temp&&sum[mid]!=-1)
    		{
    		return mid;
    		}
    		if(sum[mid]>temp&&sum[mid]!=-1)
    			r=mid-1;
    		if(sum[mid]<temp&&sum[mid]!=-1)
    			l=mid+1;
        }
    	return -1;
    }
    public static long gcd(long x,long y)
    {
    	if(x%y==0)
    		return y;
    	else
    		return gcd(y,x%y);
    }
    public static int gcd(int x,int y)
    {
    	if(x%y==0)
    		return y;
    	else
    		return gcd(y,x%y);
    }
    public static int abs(int a,int b)
    {
    	return (int)Math.abs(a-b);
    }
    public static long abs(long a,long b)
    {
    	return (long)Math.abs(a-b);
    }
    public static int max(int a,int b)
    {
    	if(a>b)
    		return a;
    	else
    		return b;
    }
    public static int min(int a,int b)
    {
    	if(a>b)
    		return b;
    	else
    		return a;
    }
    public static long max(long a,long b)
    {
    	if(a>b)
    		return a;
    	else
    		return b;
    }
    public static long min(long a,long b)
    {
    	if(a>b)
    		return b;
    	else
    		return a;
    }

    public static long pow(long n,long p,long m)
    {
    	 long  result = 1;
    	  if(p==0)
    	    return 1;
    	if (p==1)
    	    return n;
    	while(p!=0)
    	{
    	    if(p%2==1)
    	        result *= n;
    	    if(result>=m)
    	    result%=m;
    	    p >>=1;
    	    n*=n;
    	    if(n>=m)
    	    n%=m;
    	}
    	return result;
    }
    public static long pow(long n,long p)
    {
    	long  result = 1;
    	  if(p==0)
    	    return 1;
    	if (p==1)
    	    return n;
    	while(p!=0)
    	{
    	    if(p%2==1)
    	        result *= n;
    	    p >>=1;
    	    n*=n;
    	}
    	return result;

    }

    static long sort(int a[]){
         int n=a.length;
    	int b[]=new int[n];
    	return mergeSort(a,b,0,n-1);

    }

    static long mergeSort(int a[],int b[],long left,long right){
         long c=0;
         if(left<right){
          long mid=left+(right-left)/2;
    	 c= mergeSort(a,b,left,mid);
    	 c+=mergeSort(a,b,mid+1,right);
    	 c+=merge(a,b,left,mid+1,right);
         }
    	return c;
    }
    static long merge(int a[],int  b[],long left,long mid,long right){
         long c=0;int i=(int)left;int j=(int)mid; int k=(int)left;
         while(i<=(int)mid-1&&j<=(int)right){
              if(a[i]<=a[j]){
                   b[k++]=a[i++];
              }
              else{
                   b[k++]=a[j++];c+=mid-i;
              }
         }

         while (i <= (int)mid - 1)
                 b[k++] = a[i++];
         while (j <= (int)right)
                 b[k++] = a[j++];
         for (i=(int)left; i <= (int)right; i++)
    	        a[i] = b[i];
    	        return c;
         }

    }


    import java.util.*;
    import java.lang.Math;
    import java.util.Arrays;
    import java.util.Scanner;
    import java.util.stream.IntStream;
    import java.io.OutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;

    public class Problem {
       	public static void main(String[] args) {
    	   InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            Scanner in = new Scanner(inputStream);
            PrintWriter out = new PrintWriter(outputStream);
            TaskA solver = new TaskA();
            solver.solve(1, in, out);
            out.close();
    	}

    	static class TaskA {
          public void solve(int testNumber, Scanner in, PrintWriter out) {
                  String a = in.next();
                  String b = in.next();

                  if(a.length()>=b.length()){
                      if(a.contains(b)){
                           out.print("-1");
                           return;
                      }
                      else{
                           out.print(a);
                      }
                  }
                  else{
                       if(b.contains(a)){
                            out.print("-1");
                            return;
                       }
                       else{
                            out.print(b);
                            return;
                       }
                  }

          }
    	}

    public int factorial(int n) {
            int fact = 1;
            int i = 1;
           while(i <= n) {
             fact *= i;
             i++;
           }
            return fact;
    }

    public static int BinarySearch(long temp,long[] sum,int r)
    {
    	int l=0;

    	while(l<=r)
    	{
    		int mid=l+(r-l)/2;
    		if(sum[mid]==temp&&sum[mid]!=-1)
    		{
    		return mid;
    		}
    		if(sum[mid]>temp&&sum[mid]!=-1)
    			r=mid-1;
    		if(sum[mid]<temp&&sum[mid]!=-1)
    			l=mid+1;
        }
    	return -1;
    }
    public static long gcd(long x,long y)
    {
    	if(x%y==0)
    		return y;
    	else
    		return gcd(y,x%y);
    }
    public static int gcd(int x,int y)
    {
    	if(x%y==0)
    		return y;
    	else
    		return gcd(y,x%y);
    }
    public static int abs(int a,int b)
    {
    	return (int)Math.abs(a-b);
    }
    public static long abs(long a,long b)
    {
    	return (long)Math.abs(a-b);
    }
    public static int max(int a,int b)
    {
    	if(a>b)
    		return a;
    	else
    		return b;
    }
    public static int min(int a,int b)
    {
    	if(a>b)
    		return b;
    	else
    		return a;
    }
    public static long max(long a,long b)
    {
    	if(a>b)
    		return a;
    	else
    		return b;
    }
    public static long min(long a,long b)
    {
    	if(a>b)
    		return b;
    	else
    		return a;
    }

    public static long pow(long n,long p,long m)
    {
    	 long  result = 1;
    	  if(p==0)
    	    return 1;
    	if (p==1)
    	    return n;
    	while(p!=0)
    	{
    	    if(p%2==1)
    	        result *= n;
    	    if(result>=m)
    	    result%=m;
    	    p >>=1;
    	    n*=n;
    	    if(n>=m)
    	    n%=m;
    	}
    	return result;
    }
    public static long pow(long n,long p)
    {
    	long  result = 1;
    	  if(p==0)
    	    return 1;
    	if (p==1)
    	    return n;
    	while(p!=0)
    	{
    	    if(p%2==1)
    	        result *= n;
    	    p >>=1;
    	    n*=n;
    	}
    	return result;

    }

    static long sort(int a[]){
         int n=a.length;
    	int b[]=new int[n];
    	return mergeSort(a,b,0,n-1);

    }

    static long mergeSort(int a[],int b[],long left,long right){
         long c=0;
         if(left<right){
          long mid=left+(right-left)/2;
    	 c= mergeSort(a,b,left,mid);
    	 c+=mergeSort(a,b,mid+1,right);
    	 c+=merge(a,b,left,mid+1,right);
         }
    	return c;
    }
    static long merge(int a[],int  b[],long left,long mid,long right){
         long c=0;int i=(int)left;int j=(int)mid; int k=(int)left;
         while(i<=(int)mid-1&&j<=(int)right){
              if(a[i]<=a[j]){
                   b[k++]=a[i++];
              }
              else{
                   b[k++]=a[j++];c+=mid-i;
              }
         }

         while (i <= (int)mid - 1)
                 b[k++] = a[i++];
         while (j <= (int)right)
                 b[k++] = a[j++];
         for (i=(int)left; i <= (int)right; i++)
    	        a[i] = b[i];
    	        return c;
         }

    }


import java.io.*;
public class Main {
public static void main(String args[])throws IOException
{
	BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));
	String a=obj.readLine();
	String b=obj.readLine();
	int dp[][]=new int[a.length()+1][b.length()+1];
	for(int i=1;i<=a.length();i++)
	{
		for(int j=1;j<=b.length();j++)
		{
			if(a.charAt(i-1)==b.charAt(j-1))
			{
				dp[i][j]=dp[i-1][j-1]+1;
			}
			else
			{
				dp[i][j]=Math.max(dp[i-1][j],Math.max(dp[i-1][j-1],dp[i][j-1]));
			  }
		}
	}
	if(Math.max(a.length(), b.length())!=dp[a.length()][b.length()])
	System.out.println(Math.max(a.length(), b.length()));
	else
		System.out.println(-1);
}
}


import java.io.*;
public class Main {
public static void main(String args[])throws IOException
{
	BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));
	String a=obj.readLine();
	String b=obj.readLine();
	int dp[][]=new int[Integer.MAX_VALUE][Integer.MAX_VALUE];
	for(int i=1;i<=a.length();i++)
	{
		for(int j=1;j<=b.length();j++)
		{
			if(a.charAt(i-1)==b.charAt(j-1))
			{
				dp[i][j]=dp[i-1][j-1]+1;
			}
			else
			{
				dp[i][j]=Math.max(dp[i-1][j],Math.max(dp[i-1][j-1],dp[i][j-1]));
			 }
		}
	}
	if(Math.max(a.length(), b.length())!=dp[a.length()][b.length()])
	System.out.println(Math.max(a.length(), b.length()));
	else
		System.out.println(-1);
}
}


import java.io.*;
public class Main {
public static void main(String args[])throws IOException
{
	BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));
	String a=obj.readLine();
	String b=obj.readLine();
	//int dp[][]=new int[a.length()+1][b.length()+1];
	//for(int i=1;i<=a.length();i++)
	//{
	//	for(int j=1;j<=b.length();j++)
	//	{
	//		if(a.charAt(i-1)==b.charAt(j-1))
	//		{
	//			dp[i][j]=dp[i-1][j-1]+1;
	//		}
	//		else
	//		{
	//			dp[i][j]=Math.max(dp[i-1][j],Math.max(dp[i-1][j-1],dp[i][j-1]));
	//		  }
	//	}
	//}
	if(a.length()!=b.length())
	System.out.println(Math.max(a.length(), b.length()));
	else
		if(a.equals(b))
		System.out.println(-1);
		else
			System.out.println(a.length());
}
}


import java.io.*;
public class Main {
public static void main(String args[])throws IOException
{
	BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));
	String a=obj.readLine();
	String b=obj.readLine();
	int dp[][]=new int[a.length()+1][b.length()+1];
	//for(int i=1;i<=a.length();i++)
	//{
	//	for(int j=1;j<=b.length();j++)
	//	{
	//		if(a.charAt(i-1)==b.charAt(j-1))
	//		{
	//			dp[i][j]=dp[i-1][j-1]+1;
	//		}
	//		else
	//		{
	//			dp[i][j]=Math.max(dp[i-1][j],Math.max(dp[i-1][j-1],dp[i][j-1]));
	//		  }
	//	}
	//}
	if(a.length()!=b.length())
	System.out.println(Math.max(a.length(), b.length()));
	else
		if(a.equals(b))
		System.out.println(-1);
		else
			System.out.println(a.length());
}
}


import java.io.*;
public class Main {
public static void main(String args[])throws IOException
{
	BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));
	String a=obj.readLine();
	String b=obj.readLine();
	int dp[][]=new int[100000][100000];
	for(int i=1;i<=a.length();i++)
	{
		for(int j=1;j<=b.length();j++)
		{
			if(a.charAt(i-1)==b.charAt(j-1))
			{
				dp[i][j]=dp[i-1][j-1]+1;
			}
			else
			{
				dp[i][j]=Math.max(dp[i-1][j],Math.max(dp[i-1][j-1],dp[i][j-1]));
			 }
		}
	}
	if(Math.max(a.length(), b.length())!=dp[a.length()][b.length()])
	System.out.println(Math.max(a.length(), b.length()));
	else
		System.out.println(-1);
}
}


import java.io.*;
public class Main {
public static void main(String args[])throws IOException
{
	BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));
	String a=obj.readLine();
	String b=obj.readLine();
	int dp[][]=new int[a.length()+1][b.length()+1];
	//for(int i=1;i<=a.length();i++)
	//{
	//	for(int j=1;j<=b.length();j++)
	//	{
	//		if(a.charAt(i-1)==b.charAt(j-1))
	//		{
	//			dp[i][j]=dp[i-1][j-1]+1;
	//		}
	//		else
	//		{
	//			dp[i][j]=Math.max(dp[i-1][j],Math.max(dp[i-1][j-1],dp[i][j-1]));
	//		  }
	//	}
	//}
	if(a.length()!=b.length())
	System.out.println(Math.max(a.length(), b.length()));
	else
		if(a.equals(b))
		System.out.println(-1);
}
}


import java.io.*;
public class Main {
public static void main(String args[])throws IOException
{
	BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));
	String a=obj.readLine();
	String b=obj.readLine();
	int dp[][]=new int[a.length()+1][b.length()+1];
	for(int i=1;i<=a.length();i++)
	{
		for(int j=1;j<=b.length();j++)
		{
			if(a.charAt(i-1)==b.charAt(j-1))
			{
				dp[i][j]=dp[i-1][j-1]+1;
			}
			else
			{
				dp[i][j]=Math.max(dp[i-1][j],Math.max(dp[i-1][j-1],dp[i][j-1]));
			}
		}
	}
	if(Math.max(a.length(), b.length())!=dp[a.length()][b.length()])
	System.out.println(Math.max(a.length(), b.length())-dp[a.length()][b.length()]+1);
	else
		System.out.println(-1);
}
}


import java.io.*;
public class Main {
public static void main(String args[])throws IOException
{
	BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));
	String a=obj.readLine();
	String b=obj.readLine();
	int dp[][]=new int[a.length()+1][b.length()+1];
	for(int i=1;i<=a.length();i++)
	{
		for(int j=1;j<=b.length();j++)
		{
			if(a.charAt(i-1)==b.charAt(j-1))
			{
				dp[i][j]=dp[i-1][j-1]+1;
			}
			else
			{
				dp[i][j]=Math.max(dp[i-1][j],Math.max(dp[i-1][j-1],dp[i][j-1]));
			 }
		}
	}
	if(Math.max(a.length(), b.length())!=dp[a.length()][b.length()])
	System.out.println(Math.max(a.length(), b.length()));
	else
		System.out.println(-1);
}
}


import java.io.*;
public class Main {
public static void main(String args[])throws IOException
{
	BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));
	String a=obj.readLine();
	String b=obj.readLine();
	int dp[][]=new int[a.length()+1][b.length()+1];
	for(int i=1;i<=a.length();i++)
	{
		for(int j=1;j<=b.length();j++)
		{
			if(a.charAt(i-1)==b.charAt(j-1))
			{
				dp[i][j]=dp[i-1][j-1]+1;
			}
			else
			{
				dp[i][j]=Math.max(dp[i-1][j],Math.max(dp[i-1][j-1],dp[i][j-1]));
			}
		}
	}
	if(Math.max(a.length(), b.length())!=dp[a.length()][b.length()])
	System.out.println(Math.max(a.length(), b.length()));
	else
		System.out.println(-1);
}
}


import java.math.BigInteger;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        String s1=in.next();
        String s2=in.next();

        BigInteger n = new BigInteger("2").pow(s2.length());
        n = n.subtract(new BigInteger("1"));

        String maxBinaryString = "";
        boolean done = false;

        BigInteger i = n;

        while(i.compareTo(new BigInteger("0"))>0)
        {
            int lastIndex = 0;

            String binaryString = i.toString(2);

            for(int j=0; j<binaryString.length(); j++)
            {
                if(binaryString.charAt(j)=='1')
                {
                    String c = s2.charAt(j) + "";

                    int index = s1.indexOf(c, lastIndex);

                    if(index>-1)
                    {
                        lastIndex=index+1;
                    }

                    else
                    {
                        maxBinaryString = binaryString;
                        done=true;
                        break;
                    }
                }

            }

            if(done)
                break;

            i.add(new BigInteger("1"));
        }

        String maxString = "";

        for(int j=0; j<maxBinaryString.length(); j++)
        {
            if(maxBinaryString.charAt(j)=='1')
            {
                maxString+= s2.charAt(j);
            }
        }

        if(maxString.length()>0)
        {
            System.out.println(maxString.length());
        }
        else
            System.out.println(-1);

    }
}


import java.math.BigInteger;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        String s1=in.next();
        String s2=in.next();

       if(s1.equals(s2))
           System.out.println(-1);
       else
           System.out.println(Integer.max(s1.length(), s2.length()));

    }
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        String s1=in.next();
        String s2=in.next();

        int n = (int) Math.pow(2, s2.length());

        String maxBinaryString = "";
        boolean done = false;

        for(int i=n; i>=0; i--)
        {

            int lastIndex = 0;

            String binaryString = Integer.toBinaryString(i);

            for(int j=0; j<binaryString.length(); j++)
            {
                if(binaryString.charAt(j)=='1')
                {
                    String c = s2.charAt(j) + "";

                    if(s1.substring(lastIndex).contains(c))
                    {
                        lastIndex=Math.min(i, s1.length()-1);
                    }

                    else
                    {
                        maxBinaryString = binaryString;
                        done=true;
                        break;
                    }
                }
                if(done)
                    break;
            }
        }

        String maxString = "";

        for(int i=0; i<maxBinaryString.length(); i++)
        {
            if(maxBinaryString.charAt(i)=='1')
            {
                maxString+= maxBinaryString.charAt(i);
            }
        }

        if(maxString.length()>0)
        {
            System.out.println(maxString.length());
        }
        else
            System.out.println(-1);

    }
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        String s1=in.next();
        String s2=in.next();

        int n = (int) Math.pow(2, s2.length());

        String maxBinaryString = "";
        boolean done = false;

        for(int i=n; i>=0; i--)
        {

            int lastIndex = 0;

            String binaryString = Integer.toBinaryString(i);

            for(int j=0; j<binaryString.length(); j++)
            {
                if(binaryString.charAt(j)=='1')
                {
                    String c = s2.charAt(j) + "";

                    int index = s1.indexOf(c, lastIndex);

                    if(index>-1)
                    {
                        lastIndex=index;
                    }

                    else
                    {
                        maxBinaryString = binaryString;
                        done=true;
                        break;
                    }
                }
                if(done)
                    break;
            }
        }

        String maxString = "";

        for(int i=0; i<maxBinaryString.length(); i++)
        {
            if(maxBinaryString.charAt(i)=='1')
            {
                maxString+= maxBinaryString.charAt(i);
            }
        }

        if(maxString.length()>0)
        {
            System.out.println(maxString.length());
        }
        else
            System.out.println(-1);

    }
}


import java.math.BigInteger;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        String s1=in.next();
        String s2=in.next();

        BigInteger n = new BigInteger("2").pow(s2.length());
        n = n.subtract(new BigInteger("1"));

        String maxBinaryString = "";
        boolean done = false;

        BigInteger i = n;

        while(i.compareTo(new BigInteger("0"))>0)
        {
            int lastIndex = 0;

            String binaryString = i.toString(2);

            for(int j=0; j<binaryString.length(); j++)
            {
                if(binaryString.charAt(j)=='1')
                {
                    String c = s2.charAt(j) + "";

                    int index = s1.indexOf(c, lastIndex);

                    if(index>-1)
                    {
                        lastIndex=index+1;
                    }

                    else
                    {
                        maxBinaryString = binaryString;
                        done=true;
                        break;
                    }
                }

            }

            if(done)
                break;

            i=i.subtract(new BigInteger("1"));
        }

        String maxString = "";

        for(int j=0; j<maxBinaryString.length(); j++)
        {
            if(maxBinaryString.charAt(j)=='1')
            {
                maxString+= s2.charAt(j);
            }
        }

        if(maxString.length()>0)
        {
            System.out.println(maxString.length());
        }
        else
            System.out.println(-1);

    }
}


import java.util.*;
public class Test{

    public static void main(String args[]) throws Exception
	{
	        Scanner st=new Scanner(System.in);
	String s1=st.next().trim();
	String s2=st.next().trim();
	if(s1.equals(s2)){
	        System.out.println("-1");
	}else{
	        System.out.println(Math.max(s1.length(),s2.length()));
	}

	}
}


import java.util.Scanner;
import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
// Working program using Reader Class
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;

public  class Main   {
   //  static  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
 	//static Scanner st=new Scanner(System.in);
 	static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }

 	static int n;
 	static long[] a;

 	static void max_heapify(int i){
 		int left=2*i;
 		int right=2*i+1;
 		int largest=i;
 		if(left<=n && a[left]<a[i]){
 			largest=left;
 		}else{
 			largest=i;
 		}
 		if(right<=n&&a[right]<a[largest]){
 			largest=right;
 		}
 		if(largest!=i){
 			long temp=a[largest];
 			a[largest]=a[i];
 			a[i]=temp;
 			max_heapify(largest);
 		}

 	}

 	static void addValue(long val){
 		n++;
 		a[n]=-9999999;
 		increasr_val(n,val);

 	}
 	static void increasr_val(int x,long val){
 		if(val>=a[x]){
 			a[x]=val;
 			while(x>1 && a[x/2]>a[x]){
 				long temp=a[x/2];
 				a[x/2]=a[x];
 				a[x]=temp;
 				x=x/2;
 			}

 		}
 	}
 	public long returnMax(){
 		return a[1];
 	}
 	static long extract_Max(){
 	    if(n==0){
 	        return -1;
 	    }
 	    long max=a[1];
 	    a[1]=a[n];
 	    n--;
 	    max_heapify(1);
 	    return max;

 	}

 static Reader st=new Reader();

    public static void main(String args[]) throws Exception
	{
	String s1=st.readLine().trim();
	String s2=st.readLine().trim();
	if(s1.equals(s2)){
	        System.out.println("-1");
	}else{
	        System.out.println(Math.max(s1.length(),s2.length()));
	}

	}

   static long mul(long a,long b){
	   return a*b;
   }

 public static int floor(int[] a,int x){
				int low = 0;
        		int end = a.length ;

        		while (low < end) {
        		  int mid = (low + end) >> 1;
				  if(x==a[mid])
						return mid;
            	  if (x <a[mid])

                	end = mid;

        		  else
                		low = mid+1;
				}
				return low-1;

}
public static int ceiling(int[] a,int x){
				int low=0;
				int end=a.length;
				while(low<end){
					int mid=(low+end)>>1;
					if(x==a[mid])
						return mid;
					if(x>a[mid])
						low=mid+1;
					else
						end=mid;
				}
			return low;

}

	static class InputReader
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

		public int read()
		{
			if (numChars==-1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}

				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		public int nextInt()
		{
			int c = read();

			while(isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;
			do
			{
				if(c<'0'||c>'9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));
				return res * sgn;
		}

		public double nextDouble()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.')
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.')
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			}
			while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c)
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next()
		{
			return readString();
		}

		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}

	}
	static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void p(Object...objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i]);
			}
		}

		public void pl(Object...objects) {
			p(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}

		public void flush() {
			writer.flush();
		}

		}

	  ////////////////////////////////////////////////////////////////////
    //      Number Theory

    long pow(long a,long b,long mod){
		if(b == 0)	return 1;
		long t = pow(a,b>>1,mod);
		t = (t * t) % mod;
		if((b & 1) == 1)	t = (t * a);
		if(t >= mod)	t %= mod;
		return t;
	}

    int divisor(long x,long[] a){
        long limit = x;
        int numberOfDivisors = 0;

        for (int i=1; i < limit; ++i) {
            if (x % i == 0) {
                limit = x / i;
                if (limit != i) {
                    numberOfDivisors++;
                }
                numberOfDivisors++;
            }
        }
        return numberOfDivisors;
    }

    void findSubsets(int array[]){
        long numOfSubsets = 1 << array.length;
        for(int i = 0; i < numOfSubsets; i++){
            @SuppressWarnings("unused")
			int pos = array.length - 1;
            int bitmask = i;
            while(bitmask > 0){
                if((bitmask & 1) == 1)
//                    ww.print(array[pos]+" ");
                bitmask >>= 1;
                pos--;
            }
//            ww.println();
        }
    }

    public static long gcd(long a, long b){
        return b == 0 ? a : gcd(b,a%b);
    }

    public static long lcm(int a,int b, int c){
        return lcm(lcm(a,b),c);
    }

    public static long lcm(long a, long b){
        return (a*b/gcd(a,b));
    }

    public static long invl(long a, long mod) {
        long b = mod;
        long p = 1, q = 0;
        while (b > 0) {
            long c = a / b;
            long d;
            d = a;
            a = b;
            b = d % b;
            d = p;
            p = q;
            q = d - c * q;
        }
        return p < 0 ? p + mod : p;
    }
    static  boolean[]  sieve(int n) {
        boolean prime[] = new boolean[n+1];
        for(int i=0;i<n;i++)
            prime[i] = true;

        for(int p = 2; p*p <=n; p++)
        {
            // If prime[p] is not changed, then it is a prime
            if(prime[p] == true)
            {
                // Update all multiples of p
                for(int i = p*2; i <= n; i += p)
                    prime[i] = false;
            }
        }

        return prime;
    }

    ////////////////////////////////////////////////////////////////////
   	static InputReader sc = new InputReader(System.in);
	static OutputWriter out = new OutputWriter(System.out);

	static int i() {
		return sc.nextInt();
	}

	static long l() {
		return sc.nextLong();
	}

	static double d() {
		return sc.nextDouble();
	}

	static String s() {
		return sc.readString();
	}

	static int[] iarr(int size) {
		int[] array = new int[size];
		for (int i = 0; i < size; i++) {
			array[i] = i();
		}
		return array;
	}

	static long[] larr(int size) {
		long[] array = new long[size];
		for (int i = 0; i < size; i++) {
			array[i] = l();
		}
		return array;
	}

	static double[] darr(int size) {
		double[] array = new double[size];
		for (int i = 0; i < size; i++) {
			array[i] = d();
		}
		return array;
	}

	static String[] sarr(int size) {
		String[] array = new String[size];
		for (int i = 0; i < size; i++) {
			array[i] = s();
		}
		return array;
	}

	static char[] stoc(String ss) {
		return ss.toCharArray();
	}

}


import java.util.*;
public class Test{

    public static void main(String args[]) throws Exception
	{
	        Scanner st=new Scanner(System.in);
	String s1=st.readLine().trim();
	String s2=st.readLine().trim();
	if(s1.equals(s2)){
	        System.out.println("-1");
	}else{
	        System.out.println(Math.max(s1.length(),s2.length()));
	}

	}
}


public class Test{

    public static void main(String args[]) throws Exception
	{
	        Scanner st-new Scanner(System.in);
	String s1=st.readLine().trim();
	String s2=st.readLine().trim();
	if(s1.equals(s2)){
	        System.out.println("-1");
	}else{
	        System.out.println(Math.max(s1.length(),s2.length()));
	}

	}
}


//package excerciseA;

import java.io.Console;
import java.util.Scanner;

public class aExcercise {

	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		String a = input.nextLine();
		String b = input.nextLine();
		while(true){

			if(a.isEmpty() || b.isEmpty()){
				System.out.println("Cannot have empty strings");
				a = input.next();
				b = input.next();
			}
			else if(a.length()>100000 || b.length() > 100000){
				System.out.println("Cannot exceed this 10^5 digits");
				a = input.next();
				b = input.next();
			}
			else{
				break;
			}
		}

		int result = checkLengths(a, b);

		System.out.println(result);

	}

	private static int checkLengths(String a, String b){

		if(a.length() > b.length()){
			return a.length();
		}
		else if(a.length() < b.length()){
			return b.length();
		}
		else{
			if(a.equals(b) ){
				return -1;

			}else{
				return a.length();
			}
		}

	}

}


//package excerciseA;

import java.io.Console;
import java.util.Scanner;

public class aExcercise {

	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		String a = input.next();
		String b = input.next();

		int result = checkLengths(a, b);

		System.out.println(result);

	}

	private static int checkLengths(String a, String b){

		if(a.length() > b.length()){
			return a.length();
		}
		else if(a.length() < b.length()){
			return b.length();
		}
		else{
			return -1;
		}

	}

}


//package excerciseA;

import java.io.Console;
import java.util.Scanner;

public class aExcercise {

	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		String a = input.nextLine();
		String b = input.nextLine();
		while(true){

			if(a.isEmpty() && b.isEmpty()){
				System.out.println("Cannot have empty strings");
				a = input.next();
				b = input.next();
			}else{
				break;
			}
		}

		int result = checkLengths(a, b);

		System.out.println(result);

	}

	private static int checkLengths(String a, String b){

		if(a.length() > b.length()){
			return a.length();
		}
		else if(a.length() < b.length()){
			return b.length();
		}
		else{
			return -1;
		}

	}

}


//package excerciseA;

import java.io.Console;
import java.util.Scanner;

public class aExcercise {

	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		String a = input.nextLine();
		String b = input.nextLine();
		while(true){

			if(a.isEmpty() || b.isEmpty()){
				System.out.println("Cannot have empty strings");
				a = input.next();
				b = input.next();
			}
			else if(a.length()>100000 || b.length() > 100000){
				System.out.println("Cannot exceed this 10^5 digits");
				a = input.next();
				b = input.next();
			}
			else{
				break;
			}
		}

		int result = checkLengths(a, b);

		System.out.println(result);

	}

	private static int checkLengths(String a, String b){

		if(a.length() > b.length()){
			return a.length();
		}
		else if(a.length() < b.length()){
			return b.length();
		}
		else{
			if(a.equals(b) ){
				return -1;
			}else{
				return a.length();
			}
		}

	}

}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package acm;
import java.util.*;
import java.io.*;
import java.util.Scanner;
import java.io.IOException;
/**
 *
 * @author bro2
 */
    public class Acm {

        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            String a,b;
            a = sc.next();
            b = sc.next();
            int sizea = a.length();
            int sizeb = b.length();
            //System.out.println(sizea + " " + sizeb);
            if (sizea > sizeb ){
                System.out.println(sizea);
            }
            else if(sizea < sizeb){
                System.out.println(sizeb);
            }
            else {
                System.out.println(-1);
            }

    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package acm;
import java.util.*;
import java.io.*;
import java.util.Scanner;
import java.io.IOException;
/**
 *
 * @author bro2
 */
    public class Acm {

        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            String a,b;
            a = sc.next();
            b = sc.next();
            int sizea = a.length();
            int sizeb = b.length();
            //System.out.println(sizea + " " + sizeb);
            if (sizea > sizeb ){
                System.out.println(sizea);
            }
            if(sizea < sizeb){
                System.out.println(sizeb);
            }

            if((sizea == sizeb) &&(a.equals(b))) {
                System.out.println(-1);
            }
            else if (sizea == sizeb){
                System.out.println(sizea);
            }

    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package acm;
import java.util.*;
import java.io.*;
import java.util.Scanner;
import java.io.IOException;
/**
 *
 * @author bro2
 */
    public class Acm {

        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            String a,b;
            a = sc.next();
            b = sc.next();
            int sizea = a.length();
            int sizeb = b.length();
            //System.out.println(sizea + " " + sizeb);
            if (sizea > sizeb ){
                System.out.println(sizea);
            }
            if(sizea < sizeb){
                System.out.println(sizeb);
            }

            if((sizea == sizeb) &&(a.matches(b))) {
                System.out.println(-1);
            }
            else if ((sizea == sizeb)){
                System.out.println(sizea);
            }

    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package acm;
import java.util.*;
import java.io.*;
import java.util.Scanner;
import java.io.IOException;
/**
 *
 * @author bro2
 */
    public class Acm {

        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            String a,b;
            a = sc.next();
            b = sc.next();
            int sizea = a.length();
            int sizeb = b.length();
            //System.out.println(sizea + " " + sizeb);
            if (sizea > sizeb ){
                System.out.println(sizea);
            }
            if(sizea < sizeb){
                System.out.println(sizeb);
            }

            if(sizea == sizeb) {
                System.out.println(-1);
            }

    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package acm;
import java.util.*;
import java.io.*;
import java.util.Scanner;
import java.io.IOException;
/**
 *
 * @author bro2
 */
    public class Acm {

        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            String a,b;
            a = sc.next();
            b = sc.next();
            int sizea = a.length();
            int sizeb = b.length();
            //System.out.println(sizea + " " + sizeb);
            if (sizea > sizeb ){
                System.out.println(sizea);
            }
            else if(sizea < sizeb){
                System.out.println(sizeb);
            }
            else if(sizea == sizeb) {
                System.out.println(sizeb);
            }

    }
}


import java.io.PrintWriter;
import java.util.Scanner;

public class MahmoudLongestUncommonSubsequence {
  public static PrintWriter out = new PrintWriter(System.out);
  public static Scanner in = new Scanner(System.in);

  public static void main(String[] args) {
    //      int t = ni();
    //      while (t-- > 0)
    solve();
    out.flush();
  }

  static int max = 0;

  private static void solve() {
    char[] a = in.next().toCharArray();
    char[] b = in.next().toCharArray();
    max = 0;
    int len = 0;
    int j = 0;
    for (char c : b) {
      if (j < a.length && a[j] == c) {
        len = 0;
        j++;
      } else {
        j = 0;
        len++;
      }
      max = Math.max(max, len);
    }
    out.println(max == 0 ? -1 : max);
  }

  private static void cal(char[] a, char[] b, int i, int j, int len) {
    if (i >= a.length || j >= b.length) return;
    if (a[i] != b[j]) {
      max = Math.max(max, len + 1);
      cal(a, b, i + 1, j + 1, len + 1);
    } else {
      cal(a, b, i, j + 1, 0);
      cal(a, b, i + 1, j, 0);
    }
  }

  private static int ni() {
    return in.nextInt();
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++) a[i] = ni();
    return a;
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++) a[i] = nl();
    return a;
  }

  private static long nl() {
    return in.nextLong();
  }

  private float nf() {
    return in.nextFloat();
  }

  private static double nd() {
    return in.nextDouble();
  }
}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class MahmoudLongestUncommonSubsequence {
  public static PrintWriter out = new PrintWriter(System.out);
  public static Scanner in = new Scanner(System.in);

  public static void main(String[] args) {
    //      int t = ni();
    //      while (t-- > 0)
    solve();
    out.flush();
  }

  static int max = 0;

  private static void solve() {
    char[] a = in.next().toCharArray();
    char[] b = in.next().toCharArray();
    if (!Arrays.equals(a,b)){
      out.println(b.length);
      return;
    } max = 0;
    int len = 0;
    int j = 0;
    for (char c : b) {
      if (j < a.length && a[j] == c) {
        len = 0;
        j++;
      } else {
        j = 0;
        len++;
      }
      max = Math.max(max, len);
    }
    out.println(max == 0 ? -1 : max);
  }

  private static void cal(char[] a, char[] b, int i, int j, int len) {
    if (i >= a.length || j >= b.length) return;
    if (a[i] != b[j]) {
      max = Math.max(max, len + 1);
      cal(a, b, i + 1, j + 1, len + 1);
    } else {
      cal(a, b, i, j + 1, 0);
      cal(a, b, i + 1, j, 0);
    }
  }

  private static int ni() {
    return in.nextInt();
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++) a[i] = ni();
    return a;
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++) a[i] = nl();
    return a;
  }

  private static long nl() {
    return in.nextLong();
  }

  private float nf() {
    return in.nextFloat();
  }

  private static double nd() {
    return in.nextDouble();
  }
}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class MahmoudLongestUncommonSubsequence {
  public static PrintWriter out = new PrintWriter(System.out);
  public static Scanner in = new Scanner(System.in);

  public static void main(String[] args) {
    //      int t = ni();
    //      while (t-- > 0)
    solve();
    out.flush();
  }

  static int max = 0;

  private static void solve() {
    char[] a = in.next().toCharArray();
    char[] b = in.next().toCharArray();
    if (!Arrays.equals(a, b)) {
      out.println(Math.max(a.length, b.length));
    } else {
      out.println("-1");
    }
  }

  private static int ni() {
    return in.nextInt();
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++) a[i] = ni();
    return a;
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++) a[i] = nl();
    return a;
  }

  private static long nl() {
    return in.nextLong();
  }

  private float nf() {
    return in.nextFloat();
  }

  private static double nd() {
    return in.nextDouble();
  }
}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class MahmoudLongestUncommonSubsequence {
  public static PrintWriter out = new PrintWriter(System.out);
  public static Scanner in = new Scanner(System.in);

  public static void main(String[] args) {
    //      int t = ni();
    //      while (t-- > 0)
    solve();
    out.flush();
  }

  static int max = 0;

  private static void solve() {
    char[] a = in.next().toCharArray();
    char[] b = in.next().toCharArray();
    if (!Arrays.equals(a,b)){
      out.println(Math.max(a.length,b.length));
      return;
    } max = 0;
    int len = 0;
    int j = 0;
    for (char c : b) {
      if (j < a.length && a[j] == c) {
        len = 0;
        j++;
      } else {
        j = 0;
        len++;
      }
      max = Math.max(max, len);
    }
    out.println(max == 0 ? -1 : max);
  }

  private static void cal(char[] a, char[] b, int i, int j, int len) {
    if (i >= a.length || j >= b.length) return;
    if (a[i] != b[j]) {
      max = Math.max(max, len + 1);
      cal(a, b, i + 1, j + 1, len + 1);
    } else {
      cal(a, b, i, j + 1, 0);
      cal(a, b, i + 1, j, 0);
    }
  }

  private static int ni() {
    return in.nextInt();
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++) a[i] = ni();
    return a;
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++) a[i] = nl();
    return a;
  }

  private static long nl() {
    return in.nextLong();
  }

  private float nf() {
    return in.nextFloat();
  }

  private static double nd() {
    return in.nextDouble();
  }
}


import java.til.*;
public class u{
    public static vid main(String a[]){
        Scanner sc=new Scanner(System.in);
        String a,b;
        a=sc.next();
        b=sc.next();
        if(a.compareTo(b)==0){
            System.out.println("-1");
        }else{
            System.out.println(Math.max(a.length(),b.length()));
        }
    }
}


import java .io.*;
public class ut{

    public static void main(String a[]){
        Scanner sc=new Scanner(System.in);
        String a,b;
        a=sc.next();
        b=sc.next();
        if(a.compareTo(b)==0){
            System.out.pritnln("-1");
        }else{
            System.out.println(Math.max(a.length(),b.length()));
        }
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class a {

    Scanner sc;
    PrintWriter out;

    void solve(){
        //Enter code here utkarsh
        String a,b;
        a=sc.next();
        b=sc.next();
        if(a.compareTo(b)==0){
            out.println("-1");
        }else{
            out.println(Math.max(a.length(),b.length()));
        }
    }

    public static void main(String[] args) {    new a().run();    }
    void run(){
        sc=new Scanner(System.in);
        out=new PrintWriter(System.out);
        solve();
        out.flush();
    }
}


import java.util.*;
public class u{
    public static vid main(String a[]){
        Scanner sc=new Scanner(System.in);
        String a,b;
        a=sc.next();
        b=sc.next();
        if(a.compareTo(b)==0){
            System.out.println("-1");
        }else{
            System.out.println(Math.max(a.length(),b.length()));
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * @author MiloMurphy
 */
public class LUCS {

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static FastReader in = new FastReader();

    public static void main(String[] args) {

        int t = 1; // in.nextInt();
        while (t-- > 0) {
            solve();
        }
    }

    public static void solve() {

        String a = in.next();
        String b = in.next();
        int lucs[][] = new int[a.length() + 1][b.length() + 1];

        for (int i = 0; i <= a.length(); ++i) {
            for (int j = 0; j <= b.length(); ++j) {

                if (i == 0 || j == 0) {
                    lucs[i][j] = 1;
                }
                else if (a.charAt(i - 1) != b.charAt(j - 1)) {
                    lucs[i][j] = lucs[i - 1][j - 1] + 1;
                } else {
                    lucs[i][j] = max(lucs[i - 1][j], lucs[i][j - 1]);
                }

            }
        }
        int ans = lucs[a.length()][b.length()];

        System.out.println((ans == 0 ? -1 : ans));

    }

    public static int max(int a, int b) {
        return a > b ? a : b;
    }

    public static int min(int a, int b) {
        return a < b ? a : b;
    }

    public static int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, (a % b));
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * @author MiloMurphy
 */
public class LUCS {

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static FastReader in = new FastReader();

    public static void main(String[] args) {

        int t = 1; // in.nextInt();
        while (t-- > 0) {
            solve();
        }
    }

    public static void solve() {

        String a = in.next();
        String b = in.next();
        System.out.println((a.equals(b)? -1:max(a.length(), b.length())));

    }

    public static int max(int a, int b) {
        return a > b ? a : b;
    }

    public static int min(int a, int b) {
        return a < b ? a : b;
    }

    public static int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, (a % b));
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * @author MiloMurphy
 */
public class LUCS {

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    static FastReader in = new FastReader();

    public static void main(String[] args) {

        int t = 1; // in.nextInt();
        while (t-- > 0) {
            solve();
        }
    }

    public static void solve() {

        String a = in.next();
        String b = in.next();
        int lucs[][] = new int[a.length() + 1][b.length() + 1];

        for (int i = 0; i <= a.length(); ++i) {
            for (int j = 0; j <= b.length(); ++j) {

                if (i == 0 || j == 0) {
                    lucs[i][j] = 0;
                }
                else if (a.charAt(i - 1) != b.charAt(j - 1)) {
                    lucs[i][j] = lucs[i - 1][j - 1] + 1;
                } else {
                    lucs[i][j] = max(lucs[i - 1][j], lucs[i][j - 1]);
                }

            }
        }
        int ans = lucs[a.length()][b.length()];

        System.out.println((ans == 0 ? -1 : ans));

    }

    public static int max(int a, int b) {
        return a > b ? a : b;
    }

    public static int min(int a, int b) {
        return a < b ? a : b;
    }

    public static int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, (a % b));
    }
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
  Scanner input = new Scanner(System.in);
         Scanner input = new Scanner(System.in);
        String a,b;
        a=input.next();
        b=input.next();

        if(a.equals(b))
            System.out.println(-1);
       else if(a.length()>b.length())
System.out.println(a.length());
        else
            System.out.println(b.length());
}
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
  Scanner input = new Scanner(System.in);
         Scanner input = new Scanner(System.in);
        String a,b;
        a=input.next();
        b=input.next();

        if(a.equals(b))
            System.out.println(-1);
        if(a.length()>b.length())
System.out.println(a.length());
        else
            System.out.println(b.length());
}
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

         Scanner input = new Scanner(System.in);
        String a,b;
        a=input.next();
        b=input.next();

        if(a.equals(b))
            System.out.println(-1);
       else if(a.length()>b.length())
System.out.println(a.length());
        else
            System.out.println(b.length());
}
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
  Scanner input = new Scanner(System.in);

        String a,b;
        a=input.next();
        b=input.next();

        if(a.equals(b))
            System.out.println(-1);
        if(a.length()>b.length())
System.out.println(a.length());
        else
            System.out.println(b.length());
}
}


import java.util.*;

public class Test {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s1 = in.next();
        String s2 = in.next();
        System.out.println(s1.equals(s2) ? -1 : Math.max(s1.length(), s2.length()));
    }
}


import java.util.*;

public class Sub {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        String a = in.next();
        String b = in.next();
        System.out.println(a.equals(b) ? -1 : Math.max(a.length(), b.length()));

    }
}


import java.util.*;

public class Test {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s1 = in.next();
        String s2 = in.next();
        int max = 0;
        for (int i = 0; i < s1.length(); i++) {
            int r = 1;
            for (int j = i + 1; j < s2.length(); j++) {
                if (!s2.contains(s1.substring(i, j))) {
                    r++;
                } else {
                    break;
                }
            }
            if (r > max) {
                max = r;
            }
        }
        System.out.println(max > 1 ? max : -1);
    }
}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{
    string s1,s2;
    int ls1,ls2,c=0,i;
    cin>>s1>>s2;
    ls1=s1.length();
    ls2=s2.length();
    if(ls1==ls2)
    {
    for(i=0;i<s1.length();i++)
    {
        if(s1[i]-s2[i]==0)
        continue;
        else
        break;
    }
    }
    if(i==s1.length())
    c=1;
    if(ls1!=ls2)
    (ls1>ls2)?cout<<ls1:cout<<ls2;
    else if(ls1==ls2 && c==1)
    cout<<"-1";
    else
    cout<<ls1;
    return 0;

}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{
    string s1,s2;
    int ls1,ls2;
    cin>>s1>>s2;
    ls1=s1.length();
    ls2=s2.length();

    if(ls1!=ls2)
    (ls1>ls2)?cout<<ls1:cout<<ls2;
    else if(ls1==ls2)
    cout<<"-1";
    return 0;

}


#include<bits/stdc++.h>
using namespace std;

int main(){

    int i,l,k,j,m,n;
    string a,b;
    getline(cin,a);
    getline(cin,b);
    if(a==b) printf("-1\n");
    else{
        l=a.length();
        k=b.length();
        if(l>k){
            printf("%d\n",l);
        }
        else{
            printf("%d\n",k);
        }
    }
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <string>
#include <utility>
#include <iomanip>
#include <math.h>
#include <stdio.h>
#include <deque>
#include <chrono>
#include <map>
#include <unordered_map>
#include <cstring>
#include <array>
#include <random>

#define endl '\n'
#define optimize ios_base::sync_with_stdio(false); cin.tie(NULL);

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

using namespace std;

int main() {

    optimize;
    string a;
    string b;
    cin >> a; cin >> b;
    if (a == b) {
        printf("%d", -1);
    } else {
        printf("%lu", a.length() >  b.length() ? a.length() : b.length());
    }
    return 0;
}


#include <iostream>
#include <cstring>
#include <cmath>
#include <string>
using namespace std;

int main()
{
string a,b;
int l1 ,l2;
cin>>a>>b;
 l1 = a.size();
 l2 =b.size();
 if (l1 != l2) cout<<max(l1,l2)<<endl;
 else if (a == b) cout<<-1<<endl;
 else cout<<a.size();
    return 0;
}


#include <iostream>
#include <cstring>
#include <cmath>
using namespace std;

int main()
{
char a[100],b[100];
int a1=1,b1=1,l1,l2,g,h;

cin >>a;
cin >>b;
l1 =strlen(a);
l2 =strlen(b);
for( int i =0 ;i < 4  ; i++){
        g=( abs ( (int) a[i]-  (int) a[i+1]) );
    if( g == 1) a1+=1;
}
for( int i =0 ;i < 5  ; i++){
    h = abs ( (int) b[i]- (int) b[i+1]) ;
    if(h == 1) b1+=1;
}
if (b1>a1 || ( (b1== a1) && (l1 > 1) )) cout<<b1<<endl;
else if(a1>b1) cout <<a1<<endl;
else cout<<-1<<endl;
    return 0;
}


#include<iostream>

int main(){

    std::string a, b;
    std::cin>> a;
    std::cin>> b;

    if (a==b) std::cout<< -1;
    else if (a.length()>b.length()) std::cout<< a.length();
    else std::cout<< b.length();

    return 0;
}


#include<iostream>

int main(){

    std::string a, b;
    std::cin>> a;
    std::cin>> b;

    if (a.length()==b.length()) std::cout<< -1;
    else if (a.length()>b.length()) std::cout<< a.length();
    else std::cout<< b.length();

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    string a,b;
    cin>>a>>b;
    if (a!=b)cout<<max(a.length(),b.length())<<'\n';
    else cout<<-1<<'\n';
    return 0;
}


function out(a, b){return (a===b)?-1:(a.length > b.length)?a.length:b.length}
print(out(readline(),readline()))


var out = function(a, b){return (a===b)?-1:Math.max(a.length,b.length)}
print(out(readline(),readline()))


var a = readline();
var b = readline();
if(a==b)
    print(-1);
else
    print(Math.max(a.length,b.length));


var x = readline();
var y = readline();

if (x == y) {
  print(-1);
} else {
  print(parseInt(Math.max(x.length,y.length)));
}


var x = readline();
var y = readline();

if (x == y) {
  print(-1);
} else {
  print(ParseInt(Math.max(x.length,y.length)));
}


s1 = readline();
s2 = readline();
ans = -1;
if(s1 !== s2){
    ans = Math.max(s1.length, s2.length);
}
print(ans);


/* global readline, print */
const a = readline()
const b = readline()

if (a === b) print(-1)
else print(Math.max(a.length, b.length))


/* global readline, print */
const a = readline()
const b = readline()

function findSubsequencesOfLength (str, length) {
  return Array(str.length - length + 1)
    .fill()
    .map((_, idx) => str.slice(idx, idx + length))
}

function findSubsequences (str) {
  return Array(str.length)
    .fill()
    .map((_, idx) => findSubsequencesOfLength(str, str.length - idx))
    .reduce((result, tmp) => result.concat(tmp), [])
}

const subA = findSubsequences(a)
const subB = findSubsequences(b)
const subAll = subA.concat(subB).sort((a, b) => (a.length - b.length) * -1)

var sentinel = 0
var found = false
while (!found && sentinel < subAll.length) {
  if (a.indexOf(subAll[sentinel]) === -1 || b.indexOf(subAll[sentinel]) === -1) {
    print(subAll[sentinel].length)
    found = true
  } else {
    sentinel++
  }
}

if (!found) {
  print(-1)
}


var a = readline(),
    b = readline(),
    arr = [],
    res = 0;

if (a.length > b.length) res = a.length;
else if (b.length > a.length) res = b.length;
else if (a === b) res = -1;
else {
    res = a.length;
}

print(res);


var s1 =readline();
var s2 = readline();
var p =function () {if (s1!==s2) {return Math.max(s1.length,s2.length)} else return -1};
print (p());


#include<cstdio>
#include<iostream>
#include<stack>

using namespace std;

#define MAXN 1000000

int len[MAXN]={0};

int main(){
#ifndef ONLINE_JUDGE
  freopen("data","r",stdin);
#endif

  string s;
  stack<int> st;
  int k,maxl=0,n=0;
  cin>>s;

  for(int i=0; i<s.size(); i++){
    if('(' == s[i]){
      st.push(i);
    }else{
      if(!st.empty()){
        k = st.top();
        st.pop();

        len[i] = ( k>0 ? len[k-1] : 0 ) + i+1-k;
        if(len[i]>maxl){
          maxl = len[i];
          n = 1;
        }else if(len[i]==maxl)
          n++;
      }
    }
  }

  if(maxl>0)
    cout<< maxl << " " << n << endl;
  else
    cout<<"0 1"<<endl;

#ifndef ONLINE_JUDGE
  fclose(stdin);
#endif

  return 0;
}


#include<cstdio>
#include<iostream>
#include<stack>

using namespace std;

#define MAXN 10000

int len[MAXN]={0};

int main(){
#ifndef ONLINE_JUDGE
  freopen("data","r",stdin);
#endif

  string s;
  stack<int> st;
  int k,maxl=0,n=0;
  cin>>s;

  for(int i=0; i<s.size(); i++){
    if('(' == s[i]){
      st.push(i);
    }else{
      if(!st.empty()){
        k = st.top();
        st.pop();

        len[i] = ( k>0 ? len[k-1] : 0 ) + i+1-k;
        if(len[i]>maxl){
          maxl = len[i];
          n = 1;
        }else if(len[i]==maxl)
          n++;
      }
    }
  }

  if(maxl>0)
    cout<< maxl << " " << n << endl;
  else
    cout<<"0 1"<<endl;

#ifndef ONLINE_JUDGE
  fclose(stdin);
#endif

  return 0;
}


#include<cstdio>
#include<iostream>
#include<stack>

using namespace std;

#define MAXN 10000

int len[MAXN]={0};

int main(){
#ifndef ONLINE_JUDGE
  freopen("data","r",stdin);
#endif

  string s;
  stack<int> st;
  int k,maxl=0,n=0;
  cin>>s;

  for(int i=0; i<s.size(); i++){
    if('(' == s[i]){
      st.push(i);
    }else{
      if(!st.empty()){
        k = st.top();
        st.pop();

        len[i] = ( k-1>0 ? len[k-1] : 0 ) + i+1-k;
        if(len[i]>maxl){
          maxl = len[i];
          n = 1;
        }else if(len[i]==maxl)
          n++;
      }
    }
  }

  if(maxl>0)
    cout<< maxl << " " << n << endl;
  else
    cout<<"0 1"<<endl;

#ifndef ONLINE_JUDGE
  fclose(stdin);
#endif
}


#include<cstdio>
#include<iostream>

using namespace std;

int findLong(const string &s, int begin){
  int left=0;

  while(left>-1 && begin<s.size()){
    if('(' == s[begin])
      left++;
    else
      left--;

    begin++;
  }

  //return next begin
  if(begin == s.size())
    if(left == 0)
      return begin;
    else
      return begin+1;
  else //left == -1
    return begin-1;
}

int main(){
#ifndef ONLINE_JUDGE
  freopen("data","r",stdin);
#endif

  string s;
  int maxl,len;
  int begin=0,next=0;
  int n=0;

  cin>>s;

  while(begin<s.size()){
#ifndef ONLINE_JUDGE
    cout<<begin<<endl;
#endif
    next = findLong(s,begin);

    if( next == s.size()+1 )
      begin = next;
    else if(next == begin)
      begin++;
    else{
      len = next-begin;
      if(len>maxl){
        maxl = len;
        n=1;
      }else if(len==maxl)
        n++;

      begin = next;
    }
  }

  if(0==n)
    n=1;
  cout<<maxl<<" "<<n<<endl;
#ifndef ONLINE_JUDGE
  fclose(stdin);
#endif

  return 0;
}


#include<cstdio>
#include<iostream>

using namespace std;

int findLong(const string &s, int begin){
  int left=0;

  while(left>-1 && begin<s.size()){
    if('(' == s[begin])
      left++;
    else
      left--;

    begin++;
  }

  //return next begin
  if(begin == s.size())
    if(left == 0)
      return begin;
    else
      return begin+1;
  else //left == -1
    return begin-1;
}

int main(){
#ifndef ONLINE_JUDGE
  freopen("data","r",stdin);
#endif

  string s;
  int maxl=0,len=0;
  int begin=0,next=0;
  int n=0;

  cin>>s;

  while(begin<s.size()){
    next = findLong(s,begin);

#ifndef ONLINE_JUDGE
    cout<<begin<<endl;
#endif

    if( next == s.size()+1 )
      begin = next;
    else if(next == begin)
      begin++;
    else{
      len = next-begin;
      if(len>maxl){
        maxl = len;
        n=1;
      }else if(len==maxl)
        n++;

      begin = next;
    }
  }

  if(0==n)
    n=1;
  cout<<maxl<<" "<<n<<endl;
#ifndef ONLINE_JUDGE
  fclose(stdin);
#endif

  return 0;
}


#include<cstdio>
#include<iostream>

using namespace std;

int findLong(const string &s, int begin){
  int left=0;
  int next = begin+1;

  while(left>-1 && begin<s.size()){
    if('(' == s[begin])
      left++;
    else
      left--;

    if(left == 0)
      next = begin+1;

    begin++;
  }

  return next;
}

int main(){
#ifndef ONLINE_JUDGE
  freopen("data","r",stdin);
#endif

  string s;
  int maxl=0,len=0;
  int begin=0,next=0;
  int n=0;

  cin>>s;

  while(begin<s.size()){
    next = findLong(s,begin);

#ifndef ONLINE_JUDGE
    cout<<begin<<endl;
#endif

    if(next == begin+1)
      begin = next;
    else{
      len = next-begin;
      if(len>maxl){
        maxl = len;
        n=1;
      }else if(len==maxl)
        n++;

      begin = next;
    }
  }

  if(0==n)
    n=1;
  cout<<maxl<<" "<<n<<endl;
#ifndef ONLINE_JUDGE
  fclose(stdin);
#endif

  return 0;
}


#include<cstdio>
#include<iostream>

using namespace std;

int findLong(const string &s, int begin){
  int left=0;

  while(left>-1 && begin<s.size()){
    if('(' == s[begin])
      left++;
    else
      left--;

    begin++;
  }

  //return next begin
  if(begin == s.size())
    if(left == 0)
      return begin;
    else
      return begin+1;
  else //left == -1
    return begin-1;
}

int main(){
#ifndef ONLINE_JUDGE
  freopen("data","r",stdin);
#endif

  string s;
  int maxl,len;
  int begin=0,next=0;
  int n=0;

  cin>>s;

  while(begin<s.size()){
    next = findLong(s,begin);

#ifndef ONLINE_JUDGE
    cout<<begin<<endl;
#endif

    if( next == s.size()+1 )
      begin = next;
    else if(next == begin)
      begin++;
    else{
      len = next-begin;
      if(len>maxl){
        cout<<next<<" "<<begin<<endl;
        maxl = len;
        n=1;
      }else if(len==maxl)
        n++;

      begin = next;
    }
  }

  if(0==n)
    n=1;
  cout<<maxl<<" "<<n<<endl;
#ifndef ONLINE_JUDGE
  fclose(stdin);
#endif

  return 0;
}


#include<cstdio>
#include<iostream>
#include<stack>

using namespace std;

#define MAXN 100000

int len[MAXN]={0};

int main(){
#ifndef ONLINE_JUDGE
  freopen("data","r",stdin);
#endif

  string s;
  stack<int> st;
  int k,maxl=0,n=0;
  cin>>s;

  for(int i=0; i<s.size(); i++){
    if('(' == s[i]){
      st.push(i);
    }else{
      if(!st.empty()){
        k = st.top();
        st.pop();

        len[i] = ( k>0 ? len[k-1] : 0 ) + i+1-k;
        if(len[i]>maxl){
          maxl = len[i];
          n = 1;
        }else if(len[i]==maxl)
          n++;
      }
    }
  }

  if(maxl>0)
    cout<< maxl << " " << n << endl;
  else
    cout<<"0 1"<<endl;

#ifndef ONLINE_JUDGE
  fclose(stdin);
#endif

  return 0;
}


#include <iostream>
#include <stack>
using namespace std;
int main()
{
    stack<int> index;
    string s;
    cin>>s;
    int i,n=s.size(),o=0,idx,ans=0,k=0,ansidx=0;
    bool flag=false;
    for(i=0;i<n;i++)
    {
        if(s[i]=='(')
        {
            if(o==0 && flag==false)
            {
                idx=i+1;
                flag=true;
            }
            o++;
            index.push(i+1);
        }
        if(s[i]==')')
        {
            if(o>0)
            {
                index.pop();
                k+=2;
            }
            o--;
        }
        if(o<0)
        {
            if(ans<k)
            {
                ans=k;
                ansidx=idx;
            }
            k=0;
            o=0;
            idx=i+1;
            flag=false;
        }
    }
    if(ans<k)
    {
        ans=k;
        ansidx=idx;
    }
    if(ans==0)
        cout<<0<<" "<<1;
    else
        cout<<ans<<" "<<ansidx;
    return 0;
}


#include <iostream>
#include <stack>
using namespace std;
int main()
{
    stack<int> index;
    string s;
    cin>>s;
    int i,n=s.size(),o=0,ans=0,k=0,num=0;
    bool flag=false;
    for(i=0;i<n;i++)
    {
        if(s[i]=='(')
        {
            o++;
            index.push(i+1);
        }
        if(s[i]==')')
        {
            if(o>0)
            {
                index.pop();
                k+=2;
            }
            o--;
        }
        if(o<0)
        {
            if(ans<=k)
            {
                if(ans==k)
                    num++;
                if(ans<k)
                {
                    ans=k;
                    num=1;
                }
            }
            k=0;
            o=0;
        }
    }
    if(ans==k)
        num++;
    if(ans<k)
    {
        ans=k;
        num=1;
    }
    if(ans==0)
        cout<<0<<" "<<1;
    else
        cout<<ans<<" "<<num;
    return 0;
}


#include <iostream>
#include <stack>
using namespace std;
int a[100005];
int main()
{
    string s;
    cin>>s;
    int n=s.size();
    stack<pair<char,int> > st;
    int i;
    for(i=0;i<n;i++)
    {
        if(i==0 || st.empty())
        {
            st.push(make_pair(s[0],i));
            continue;
        }
        if(st.top().first==')' && s[i]=='(')
        {
            st.push(make_pair(s[i],i));
            continue;
        }
        if(st.top().first==s[i])
            st.push(make_pair(s[i],i));
        else
        {
            a[st.top().second]=1;
            a[i]++;
            st.pop();
        }
    }
    int Max=0,d=1,sum=0;
    for(i=0;i<n;i++)
    {
        if(a[i]==0)
        {
            if(sum>=Max && sum>0)
            {
                if(sum>Max)
                {
                    Max=sum;
                    d=1;
                }
                else
                    d++;
            }
            sum=0;
        }
        else
            sum++;
    }
    if(sum>=Max && sum>0)
    {
        if(sum>Max)
        {
            Max=sum;
            d=1;
        }
        else
            d++;
    }
    cout<<Max<<" "<<d;
    return 0;
}


#include <iostream>
#include <stack>
using namespace std;
int main()
{
    stack<int> index;
    string s;
    cin>>s;
    int i,n=s.size(),o=0,idx,ans=0,k=0,ansidx=0;
    for(i=0;i<n;i++)
    {
        if(s[i]=='(')
        {
            o++;
            index.push(i+1);
        }
        if(s[i]==')' && o>0)
        {
            o--;
            idx=index.top();
            index.pop();
            k+=2;
        }
        if(o==0 && ans<k)
        {
            ans=k;
            ansidx=idx;
            k=0;
        }
    }
    if(ans==0)
        cout<<0<<" "<<1;
    else
        cout<<ans<<" "<<ansidx;
    return 0;
}


#include <iostream>
#include <stack>
using namespace std;
int main()
{
    stack<int> index;
    string s;
    cin>>s;
    int i,n=s.size(),o=0,idx,ans=0,k=0;
    for(i=0;i<n;i++)
    {
        if(s[i]=='(')
        {
            o++;
            index.push(i+1);
        }
        if(s[i]==')' && o>0)
        {
            o--;
            idx=index.top();
            index.pop();
            k+=2;
        }
        if(o==0)
        {
            ans=max(ans,k);
            k=0;
        }
    }
    if(ans==0)
        cout<<0<<" "<<1;
    else
        cout<<ans<<" "<<idx;
    return 0;
}


#include <iostream>
#include <stack>
using namespace std;
int a[100005];
int main()
{
    string s;
    cin>>s;
    int n=s.size();
    stack<pair<char,int> > st;
    int i;
    for(i=0;i<n;i++)
    {
        if(i==0 || st.empty())
        {
            st.push(make_pair(s[i],i));
            continue;
        }
        if(st.top().first==')' && s[i]=='(')
        {
            st.push(make_pair(s[i],i));
            continue;
        }
        if(st.top().first==s[i])
            st.push(make_pair(s[i],i));
        else
        {
            a[st.top().second]=1;
            a[i]++;
            st.pop();
        }
    }
    int Max=0,d=1,sum=0;
    for(i=0;i<n;i++)
        cout<<a[i]<<" ";
    cout<<endl;
    for(i=0;i<n;i++)
    {
        if(a[i]==0)
        {
            if(sum>=Max && sum>0)
            {
                if(sum>Max)
                {
                    Max=sum;
                    d=1;
                }
                else
                    d++;
            }
            sum=0;
        }
        else
            sum++;
    }
    if(sum>=Max && sum>0)
    {
        if(sum>Max)
        {
            Max=sum;
            d=1;
        }
        else
            d++;
    }
    cout<<Max<<" "<<d;
    return 0;
}


#include <iostream>
#include <stack>
using namespace std;
int a[100005];
int main()
{
    string s;
    cin>>s;
    int n=s.size();
    stack<pair<char,int> > st;
    int i;
    for(i=0;i<n;i++)
    {
        if(i==0 || st.empty())
        {
            st.push(make_pair(s[i],i));
            continue;
        }
        if(st.top().first==')' && s[i]=='(')
        {
            st.push(make_pair(s[i],i));
            continue;
        }
        if(st.top().first==s[i])
            st.push(make_pair(s[i],i));
        else
        {
            a[st.top().second]=1;
            a[i]++;
            st.pop();
        }
    }
    int Max=0,d=1,sum=0;
    for(i=0;i<n;i++)
    {
        if(a[i]==0)
        {
            if(sum>=Max && sum>0)
            {
                if(sum>Max)
                {
                    Max=sum;
                    d=1;
                }
                else
                    d++;
            }
            sum=0;
        }
        else
            sum++;
    }
    if(sum>=Max && sum>0)
    {
        if(sum>Max)
        {
            Max=sum;
            d=1;
        }
        else
            d++;
    }
    cout<<Max<<" "<<d;
    return 0;
}


#include <iostream>
#include <stack>
using namespace std;
int a[1000005];
int main()
{
    string s;
    cin>>s;
    int n=s.size();
    stack<pair<char,int> > st;
    int i;
    for(i=0;i<n;i++)
    {
        if(i==0 || st.empty())
        {
            st.push(make_pair(s[i],i));
            continue;
        }
        if(st.top().first==')' && s[i]=='(')
        {
            st.push(make_pair(s[i],i));
            continue;
        }
        if(st.top().first==s[i])
            st.push(make_pair(s[i],i));
        else
        {
            a[st.top().second]=1;
            a[i]++;
            st.pop();
        }
    }
    int Max=0,d=1,sum=0;
    for(i=0;i<n;i++)
    {
        if(a[i]==0)
        {
            if(sum>=Max && sum>0)
            {
                if(sum>Max)
                {
                    Max=sum;
                    d=1;
                }
                else
                    d++;
            }
            sum=0;
        }
        else
            sum++;
    }
    if(sum>=Max && sum>0)
    {
        if(sum>Max)
        {
            Max=sum;
            d=1;
        }
        else
            d++;
    }
    cout<<Max<<" "<<d;
    return 0;
}


#include"iostream"
#include"cstdio"
using namespace std;
int a[1000001];
int main(){
   char c;
   int k=0;
   int max=0,maxx=0,num=1;
   while(scanf("%c",&c)){
       k++;
       if(c=='\n')break;
       if(c=='('){
           a[k]=a[k-1]+1;
       }
       else{
           if(a[k-1]==0){max=0;continue;}
           else{
               a[k]=a[k-1]-1;
               max++;

                  if(max>maxx){maxx=max;num=1;}
                  else if(max==maxx){num++;}

           }
       }
   }
   printf("%d %d\n",maxx*2,num);
//   system("pause");
   return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>

#define inf 0x3f3f3f3f
#define Inf 0x3FFFFFFFFFFFFFFFLL
#define maxn 1000100
using namespace std;
int mark[maxn];
char str[maxn];
int main(){
    int len, res, cnt, top;
    while(~scanf("%s", str)){
        len = strlen(str);
        res = top = 0; cnt = 1; mark[0] = -1;
        for(int i=0;i<len;i++){
            if(str[i] == '('){
                top++;
                mark[top] = i;
            }
            else{
                top--;
                if(top < 0){
                    top = 0;
                    mark[0] = i;
                }
                else{
                    if(i - mark[top] > res){
                        res = i - mark[top];
                        cnt = 1;
                    }
                    else if(i - mark[top] == res){
                        cnt++;
                    }
                }
            }
        }
        printf("%d %d\n", res, cnt);
    }
    return 0;
}


#include"iostream"
#include"string"
#include"cstdio"
using namespace std;
int a[1000001];
char c[1000001];
int main(){
   int k=0;
   int max=0,maxx=0,num=1;
   a[0]=0;
   scanf("%s",c);
   for(int i=0;c[i];i++){
       k++;
       if(c[i]=='('){
           a[k]=a[k-1]+1;
       }
       else if(c[i]==')'){
           if(a[k-1]==0){a[k]=0;max=0;continue;}
           else{
               a[k]=a[k-1]-1;
               max++;

                  if(max>maxx){maxx=max;num=1;}
                  else if(max==maxx){num++;}

           }
       }
   }
   printf("%d %d\n",maxx*2,num);
  // system("pause");
   return 0;
}


#include"iostream"
#include"cstdio"
using namespace std;
int a[1000001];
int main(){
   char c;
   int k=0;
   int max=0,maxx=0,num=1;
   a[0]=0;
   while(scanf("%c",&c)){
       k++;
       if(c=='\n' || c=='\r')break;
       if(c=='('){
           a[k]=a[k-1]+1;
       }
       else if(c==')'){
           if(a[k-1]==0){a[k]=0;max=0;continue;}
           else{
               a[k]=a[k-1]-1;
               max++;

                  if(max>maxx){maxx=max;num=1;}
                  else if(max==maxx){num++;}

           }
       }
   }
   printf("%d %d\n",maxx*2,num);
   //system("pause");
   return 0;
}


#include"iostream"
#include"cstdio"
using namespace std;
int a[1000001];
int main(){
   char c;
   int k=0;
   int max=0,maxx=0,num=1;
   while(scanf("%c",&c)){
       k++;
       if(c=='\n')break;
       if(c=='('){
           a[k]=a[k-1]+1;
       }
       else{
           if(a[k-1]==0)continue;
           else{
               a[k]=a[k-1]-1;
               max++;
               if(a[k]==0){
                  if(max>maxx){maxx=max;num=1;max=0;}
                  else if(max==maxx){num++;max=0;}
               }
           }
       }
   }
   printf("%d %d\n",maxx*2,num);
   //system("pause");
   return 0;
}


#include"iostream"
#include"cstdio"
using namespace std;
int a[1000001];
int main(){
   char c;
   int k=0;
   int max=0,maxx=0,num=1;
   while(scanf("%c",&c)){
       k++;
       if(c=='\n')break;
       if(c=='('){
           a[k]=a[k-1]+1;
       }
       else{
           if(a[k-1]==0)continue;
           else{
               a[k]=a[k-1]-1;
               max++;

                  if(max>maxx){maxx=max;num=1;}
                  else if(max==maxx){num++;}
               if(a[k]==0)max=0;
           }
       }
   }
   printf("%d %d\n",maxx*2,num);
   //system("pause");
   return 0;
}


#include"iostream"
#include"cstdio"
using namespace std;
int a[1000001];
int main(){
   char c;
   int k=0;
   int max=0,maxx=0,num=1;
   a[0]=0;
   while(scanf("%c",&c)){
       k++;
       if(c=='\n')break;
       if(c=='('){
           a[k]=a[k-1]+1;
       }
       else{
           if(a[k-1]==0){a[k]=0;max=0;continue;}
           else{
               a[k]=a[k-1]-1;
               max++;

                  if(max>maxx){maxx=max;num=1;}
                  else if(max==maxx){num++;}

           }
       }
   }
   printf("%d %d\n",maxx*2,num);
   //system("pause");
   return 0;
}


#include"iostream"
#include"cstdio"
using namespace std;
int a[1000001];
int main(){
   char c;
   int k=0;
   int max=0,maxx=0,num=1;
   a[0]=0;
   while(scanf("%c",&c)){
       k++;
       if(c=='\n')break;
       if(c=='('){
           a[k]=a[k-1]+1;
       }
       else if(c==')'){
           if(a[k-1]==0){a[k]=0;max=0;continue;}
           else{
               a[k]=a[k-1]-1;
               max++;

                  if(max>maxx){maxx=max;num=1;}
                  else if(max==maxx){num++;}

           }
       }
   }
   printf("%d %d\n",maxx*2,num);
   //system("pause");
   return 0;
}


#include"iostream"
#include"string"
#include"cstdio"
using namespace std;
int a[1000001];
char c[1000001];
int main(){
   int k=0;
   int max=0,maxx=0,num=1;
   a[0]=0;
   scanf("%s",c);
   for(int i=0;i<strlen(c);i++){
       k++;
       if(c[i]=='('){
           a[k]=a[k-1]+1;
       }
       else if(c[i]==')'){
           if(a[k-1]==0){a[k]=0;max=0;continue;}
           else{
               a[k]=a[k-1]-1;
               max++;

                  if(max>maxx){maxx=max;num=1;}
                  else if(max==maxx){num++;}

           }
       }
   }
   printf("%d %d\n",maxx*2,num);
  // system("pause");
   return 0;
}


//372 ms 9100KB

#include <iostream>
#include <stack>
#include <string>
#include <cstdio>
using namespace std;

int DP[1000001];

int main()
{
    stack<int> stk;
    string str;

    cin >> str;
    int len = str.length();

    int maxLen = 0;
    int maxNum = 1;

    for (int i = 0; i < len; i++)
    {
        if (str[i] == '(')
            stk.push(i);
        else
        {
            if (!stk.empty())
            {
                int temp = stk.top();
                stk.pop();
                if (temp == 0)
                    DP[i] = i + 1;
                else
                    DP[i] = i - temp + 1 + DP[temp - 1];

                if (DP[i] > maxLen)
                {
                    maxLen = DP[i];
                    maxNum = 1;
                }

                else
                    if (DP[i] == maxLen)
                        maxNum ++;
            }
        }
    }

    printf("%d %d\n",maxLen,maxNum);
    return 0;
}


#include <iostream>
#include <stack>
#include <string>
using namespace std;

 int DP[1000001];
int main()
{

    stack<int> stk;
    string str;

    cin >> str;
    int len = str.length();

    int maxLen = 0, maxNum = 1;

    for (int i = 0; i < len; i++)
    {
        DP[i] = 0;
        if (str[i] == '(')
            stk.push(i);
        else
        {
            if (!stk.empty())
            {
                int temp = stk.top();
                stk.pop();
                if (temp == 0)
                    DP[i] = i + 1;
                else
                    DP[i] = i - temp + 1 + DP[temp - 1];

                if (DP[i] > maxLen)
                    maxLen = DP[i];

                else
                    if (DP[i] == maxLen)
                    maxNum ++;
            }
        }
    }
    cout << maxLen << ' ' << maxNum << endl;
    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <stack>
using namespace std;

int dp [1001000];
string s;
stack <int> st;

int main ()
{
  cin >> s;
  int len = s.size ();
  for (int i = 0; i <len; i ++)
  {
    if (s [i] == '(')
    {
      st.push (i);
    }
    else
    {
      if (! st.empty ())
      {
        int tmp = st.top ();
        st.pop ();
        if (tmp)
          dp [i] = dp [tmp-1] + i-tmp + 1;
        else
          dp [i] = i-tmp + 1;
      }
    }
  }
  int maxn = -1, cnt = 0;
  for (int i = 0; i <len; i ++)
  {
    if (maxn <dp [i])
    {
      maxn = dp [i];
      cnt = 1;
    }
    else if (maxn == dp [i])
    {
      cnt ++;
    }
  }
  if (maxn == 0)
    cout << "0 1" << endl;
  else
    cout << maxn << " " << cnt << endl;
  return 0;
}


//342 ms 9100KB

#include <iostream>
#include <stack>
#include <string>
using namespace std;

 int DP[1000001];
int main()
{

    stack<int> stk;
    string str;

    cin >> str;
    int len = str.length();

    int maxLen = 0;
    int maxNum = 1;

    for (int i = 0; i < len; i++)
    {
        if (str[i] == '(')
            stk.push(i);
        else
        {
            if (!stk.empty())
            {
                int temp = stk.top();
                stk.pop();
                if (temp == 0)
                    DP[i] = i + 1;
                else
                    DP[i] = i - temp + 1 + DP[temp - 1];

                if (DP[i] > maxLen)
                {
                    maxLen = DP[i];
                    maxNum = 1;
                }

                else
                    if (DP[i] == maxLen)
                        maxNum ++;
            }
        }
    }
    cout << maxLen << ' ' << maxNum << endl;
    return 0;
}


// 342ms 9100 KB
#include <iostream>
#include <stack>

using namespace std;

int main()
{
    int DP[100000];
    stack<int> st;
    string s;

    cin >> s;
    int size = s.length();

    int longest_substring = 0;
    int number_of_substring = 1;

    for (int i = 0; i < size; i++)
    {
        if (s[i] == '(')
            st.push(i);
        else
        {
            if (!st.empty())
            {
                int temp = st.top();

                st.pop();
                if (temp == 0)
                    DP[i] = ++i;

                else
                    DP[i] = i - temp + 1 + DP[temp - 1];

                if (DP[i] > longest_substring)
                {
                    longest_substring = DP[i];
                    number_of_substring = 1;
                }
                else
                    if (DP[i] == longest_substring)
                    {
                        number_of_substring++;
                    }
            }
        }
    }

    cout << longest_substring << ' ' << number_of_substring << endl;
    return 0;
}


#include <iostream>
#include <stack>
#include <string>
using namespace std;

 int DP[1000001];
int main()
{

    stack<int> stk;
    string str;

    cin >> str;
    int len = str.length();

    int maxLen = 0;
    int maxNum = 1;

    for (int i = 0; i < len; i++)
    {
        DP[i] = 0;
        if (str[i] == '(')
            stk.push(i);
        else
        {
            if (!stk.empty())
            {
                int temp = stk.top();
                stk.pop();
                if (temp == 0)
                    DP[i] = i + 1;
                else
                    DP[i] = i - temp + 1 + DP[temp - 1];

                if (DP[i] > maxLen)
                {
                    maxLen = DP[i];
                    maxNum = 1;
                }

                else
                    if (DP[i] == maxLen)
                        maxNum ++;
            }
        }
    }
    cout << maxLen << ' ' << maxNum << endl;
    return 0;
}


#include <iostream>
#include <stack>

using namespace std;

int main()
{
    string s;
    cin >> s;
    int f[s.length()];
    stack<int> st;

    int maxLen = 0, maxNum = 1;

    for (int i = 0; i < s.length(); ++i)
    {
        f[i] = 0;

        if (s[i] == '(')
            st.push(i);
        else
        {
            if (!st.empty())
            {
                int temp = st.top();
                st.pop();
                if (temp == 0)
                    f[i] = i + 1;
                else
                    f[i] = i - temp + 1 + f[temp - 1];

                if (f[i] > maxLen)
                {
                    maxLen = f[i];
                    maxNum = 1;
                }
                else if (f[i] == maxLen)
                {
                    ++maxNum;
                }
            }
        }
    }
    cout << maxLen << ' ' << maxNum << endl;
    return 0;
}


#include <bits/stdc++.h>

#define INF (int)10e6
#define eps 10e-6
#define mp make_pair
#define pub push_back
#define pob pop_back
#define all(t) t.begin(),t.end()
#define LL long long
#define MOD 1000000007
#define fr(i, a, b) for(int i = a ; i <= b ; i++)
#define frev(i, a, b) for(int i = b ; i >= a ; i--)
#define rt return

using namespace std;

//ifstream fin ("input.txt");
//ofstream fout ("output.txt");
string s;char ch;
int n, ans, anscount, x, y;
stack<pair<char, int> > stek;
int main(int argc, char** argv)
{
   std::ios::sync_with_stdio(false);
   cin.tie(NULL);
   //    freopen("input.in","r",stdin);
   //    freopen("output.out","w",stdout);
   getline(cin, s);s += "(";stek.push(mp(')', 0));
   n = s.size()-1;
   fr(i, 0, n)
   {
      if(s[i] == '(')
      {
   stek.push(mp(s[i], i+1));
      }
      else
      {
   if(stek.empty())
   {
      stek.push(mp(s[i], i+1));
   }
   else
   {
      ch = stek.top().first;
      if(ch != s[i])
      {
         stek.pop();
      }
      else
      {
         stek.push(mp(s[i], i+1));
      }
   }
      }
   }
   x = stek.top().second;stek.pop();
   while(!stek.empty())
   {
      y = stek.top().second;stek.pop();
      x = x - y;
      if(x % 2 != 0) x--;
      if(ans <= x)
      {
   if(x == ans && x != 0)
   {
      anscount++;
   }
   else
   {
      ans = x;
      anscount = 1;
   }
      }
      x = y;
   }
   cout << ans <<" "<< anscount;
   return 0;
}