#(#(#((##((()))(((#)(#()#(((()()(()#(##(((()(((()))#(((((()(((((((()#((#((()(#(((()(()##(()(((()((#(
 (#((((()
 (#((
 ((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((#)((##
 (())((((#)
 (#(
 (#))(#(#)((((#(##((#(#((((#(##((((((#((()(()(())((()#((((#((()((((#(((((#(##)(##()((((()())(((((#(((
 ##((((((()
 #((#
 #))))
 (((((#(#(#(#()
 ((#(()#(##
 (((((((((((((((((((###################
 )((##((###
 (((()#(#)(
 ((#)(
 )(((())#
 ()((#((#(#()
 ((#(
 ()#(#())()()#)(#)()##)#((()#)((#)()#())((#((((((((#)()()(()()(((((#)#(#((((#((##()(##(((#(()(#((#))#

-1
 -1
 -1
 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
 3
 -1
 -1
 -1
 -1
 -1
 1
1
1
5
 1
1
1
1
 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
 -1
 -1
 -1
 -1
 1
1
3
 -1
 -1


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;


public class Treasures {

    static class FastScanner{
        BufferedReader s;
        StringTokenizer st;
        
        public FastScanner(){
            st = new StringTokenizer("");
            s = new BufferedReader(new InputStreamReader(System.in));
        }
        
        public FastScanner(File f) throws FileNotFoundException{
            st = new StringTokenizer("");
            s = new BufferedReader (new FileReader(f));
        }
        
        public int nextInt() throws IOException{
            if(st.hasMoreTokens())
                return Integer.parseInt(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextInt();
            }
        }
        
      public double nextDouble() throws IOException{
            if(st.hasMoreTokens())
                return Double.parseDouble(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextDouble();
            }
        }
      
        public long nextLong() throws IOException{
            if(st.hasMoreTokens())
                return Long.parseLong(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextLong();
            }
        }
        
        public String nextString() throws IOException{
            if(st.hasMoreTokens())
                return st.nextToken();
            else{
                st = new StringTokenizer(s.readLine());
                return nextString();
            }
            
        }
        public String readLine() throws IOException{
            return s.readLine();
        }
        
        public void close() throws IOException{
            s.close();
        }
        
    }
      private static FastScanner s = new FastScanner();   
      private static PrintWriter ww = new PrintWriter(new OutputStreamWriter(System.out));
     
      static int count=0;
     public static void main(String[] args) throws IOException 
     {
        
       String a = s.nextString();int count=0;
       boolean arc []= new boolean[a.length()];
       for(int i=0;i<a.length();i++)
       {
          
          if(a.charAt(i)=='(')
          {count++;//ww.println(" opn count "+count);
          
          }
          else if(a.charAt(i)=='#')
          {  int t=0;
              for(int j=i+1;j<a.length();j++)
              {
                  if(a.charAt(j)==')')
                  {count--;t++;}
                   else if(a.charAt(j)=='(')
                      break;
                  //ww.println(" for # "+count);
              }
              i=i+t;
              if(count>0)
              { ww.println(""+(count));
           
                
              }
              else
              ww.println(""+-1);
              count=0;   
          }
          else if(a.charAt(i)==')')
               count--;         
       }
         
         s.close();
         ww.close();
     }
     public static int gcd(int a, int b){
        return b == 0 ? a : gcd(b,a%b);
    }
    

}
/*zabardast swappimng of sorting
/*
    for(int h=0;h<n;h++)
        {  int temp,temp1,temp2;
             for(int y=h+1;y<n;y++)
           {
             if(a[y][2]>=a[h][2])
             {
              
             temp=a[y][2];                 //////sorting
             a[y][2]=a[h][2]; 
              a[h][2]=temp;
              temp1=a[y][0];
              a[y][0]=a[h][0];
              a[h][0]=temp1;
              temp2=a[y][1];
              a[y][1]=a[h][1];
              a[h][1]=temp2;
           
             }
           }  
        }
*/
/*
static final Point getMinMax(int[] array) {
        int min = array[0];
        int max = array[0];
        
        for (int index = 0, size = array.length; index < size; ++index, ++index) {
            int value = array[index];
            
            if (index == size - 1) {
                min = min(min, value);
                max = max(max, value);
            } else {
                int otherValue = array[index + 1];
                
                if (value <= otherValue) {
                    min = min(min, value);
                    max = max(max, otherValue);
                } else {
                    min = min(min, otherValue);
                    max = max(max, value);
                }
            }
        }
        
        return new Point(min, max);
    }
    
*/
/*

/// Demonstrate several Is... methods.
class IsDemo {
public static void main(String args[]) {
char a[] = {'a', 'b', '5', '?', 'A', ' '};
for(int i=0; i<a.length; i++) {
if(Character.isDigit(a[i]))                                   ///check if digit is present in string
System.out.println(a[i] + " is a digit.");
if(Character.isLetter(a[i]))
    System.out.println(num + " in binary: " +
Integer.toBinaryString(num));
System.out.println(num + " in octal: " +
Integer.toOctalString(num));
System.out.println(num + " in hexadecimal: " +
Integer.toHexString(num));
}
}
*/
/*
private static void findSubsets(int array[])
{
  int numOfSubsets = 1 << array.length; 

  for(int i = 0; i < numOfSubsets; i++)
 {
    int pos = array.length - 1;                                /////bitmask to find all sub sets
   int bitmask = i;

   System.out.print("{");
   while(bitmask > 0)
   {
    if((bitmask & 1) == 1)
     System.out.print(array[pos]+",");
    bitmask >>= 1;
    pos--;
   }
   System.out.print("}");
 }
}
*/
/*
  public static boolean check(String a)
     {
      //  ww.println(" comes for chcking is "+a);boolean arc=true;
       if(a.length()%2==1)
       {
           int mid =a.length()/2;
         for(int j=mid-1,k=mid+1;j>=0&&k<a.length();j--,k++)
             if(a.charAt(j)!=a.charAt(k))
              return false;   
       }
        else
       {
           int mid =a.length()/2-1;
          for(int j=mid,k=mid+1;j>=0&&k<a.length();j--,k++)
             if(a.charAt(j)!=a.charAt(k))
              return false;   
          
       }
       return true;
     }
*/