Problem: Polycarp has just invented a new binary protocol for data transmission. He is encoding positive integer decimal number to binary string using following algorithm:

  * Each digit is represented with number of '1' characters equal to the value of that digit (for 0 it is zero ones). 
  * Digits are written one by one in order corresponding to number and separated by single '0' character. 



Though Polycarp learnt how to encode the numbers, he has no idea how to decode them back. Help him calculate the decoded number.

Input

The first line contains one integer number n (1 ≤ n ≤ 89) — length of the string s.

The second line contains string s — sequence of '0' and '1' characters, number in its encoded format. It is guaranteed that the number corresponding to the string is positive and doesn't exceed 109. The string always starts with '1'.

Output

Print the decoded number.

Examples

Input

3
111


Output

3


Input

9
110011101


Output

2031

Solution (in JAVA):

Solution:
	import java.io.BufferedReader;
	import java.io.IOException;
	import java.io.InputStreamReader;
	import java.io.PrintWriter;
	import java.util.ArrayList;
	import java.util.Arrays;
	import java.util.Map.Entry;
	import java.util.PriorityQueue;
	import java.util.StringTokenizer;
	import java.util.*;
	
	
	   public  class Main {
	
	
	
		/*public static int ispr(int n)
	    	{
	    	//boolean[] isPrime = new boolean[n+1];
	        for (int i = 2; i <= n; i++) {
	            Prime[i] = true;
	        }
	
	        // mark non-primes <= n using Sieve of Eratosthenes
	        for (int factor = 2; factor*factor <= n; factor++) {
	
	            // if factor is prime, then mark multiples of factor as nonprime
	            // suffices to consider mutiples factor, factor+1, ...,  n/factor
	            if (Prime[factor]) {
	                for (int j = factor; factor*j <= n; j++) {
	                    Prime[factor*j] = false;
	                }
	            }	
	        }	
	        // count primes
	
	        /*int primes = 0;
	        for (int i = 2; i <= n; i++) {
	            if (isPrime	[i])System.out.println(i);
	
	
	        }*/
		// System.out.println("The number of primes <= " + n + " is " + primes);
		//return 0;
		// if(isPrime[n]==true)return 1; else return 0;
	
		//}
	
	
	
	
	
	
	
		public static long fact(long x)
		{
			if(x==0)return 1;
			else return x*fact(x-1);
		}
	
	
		public static long exp(long x, long n, long M)
		{
	
			if(n==0) return 1;
	
			else if(n%2==0) return exp((x*x)%M,n/2,M);
			else return (x*exp((x*x)%M,(n-1)/2,M))%M;
	
		}
	
		//fi
	
		static long fib(long n)
		{
			long F[][] = new long[][]{{1,1},{1,0}};
			if (n == 0)
				return 0;
			power(F, n-1);
	
			return F[0][0];
		}
	
		static int mod=1000000007;
		
		static void multiply(long F[][], long M[][])
		{
			long x =  (((F[0][0]%mod)*(M[0][0]%mod))%mod + ((F[0][1]%mod)*(M[1][0]%mod))%mod)%mod;
			long y =  (((F[0][0]%mod)*(M[0][1]%mod))%mod + ((F[0][1]%mod)*(M[1][1]%mod))%mod)%mod;
			long z =  (((F[1][0]%mod)*(M[0][0]%mod))%mod + ((F[1][1]%mod)*(M[1][0]%mod))%mod)%mod;
			long w =  (((F[1][0]%mod)*(M[0][1]%mod))%mod + ((F[1][1]%mod)*(M[1][1]%mod))%mod)%mod;
	
			F[0][0] = x;
			F[0][1] = y;
			F[1][0] = z;
			F[1][1] = w;
		}
	
		/* Optimized version of power() in method 4 */
		static void power(long F[][], long n)				
		{
			if( n == 0 || n == 1)
				return;
			long M[][] = new long[][]{{1,1},{1,0}};
	
			power(F, n/2);
			multiply(F, F);
	
			if (n%2 != 0)
				multiply(F, M);
		}
	
	
	
	
		public static int gcd(int a, int b)
		{
			if(b==0)
				return a;
			else return gcd(b,a%b);
		}
	
		static  class MyScanner {
	
			BufferedReader br;
			StringTokenizer st;
	
			public MyScanner() {
				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 MyScanner sc = new  MyScanner();
		static PrintWriter pw = new PrintWriter(System.out, true);
		
	
		
		static void printPath(int parent[], int j)
		{
		    // Base Case : If j is source
		    if (parent[j]==-1)
		        {pw.print(j+" ");return;}
	
		    printPath(parent, parent[j]);
	
		    pw.print(j+" ");
		}
		
		
		//Main begins here :)
	/*	
		public static class Pair{
		    int a;
		    int b;
		    Pair(int p,int q){
		        a=p;
		        b=q;
		    }
		    public boolean equals(Object o) {
		        if (o instanceof Pair) {
		            Pair p = (Pair)o;
		            return p.a == a && p.b == b;
		        }
		        return false;
		    }
		    public int hashCode() {
		        return new Integer(a).hashCode() * 31 + new Integer(b).hashCode();
		    }
		}
		*/
	
	
	
		
		public static int max1(String st, int k)
		{
			int n1=0;
			int max=Integer.MIN_VALUE;
			int n = st.length();
			if(n==1)
			{
				if(st.charAt(0)=='1')return 1;
				else return 0;
			}
			
			for(int i=1;i<=k;i++)
			{
				int chp=i-1;
				
				if(st.charAt(chp)=='1')n1++;
				
			}
			max=Math.max(max, n1);
		//	if(k>=n)return max;
			int slides=n-k;
			int ptr1=0, ptr2=k-1;
			
			for(int i=1;i<=slides;i++)
			{
				//pw.println(st.substring(ptr1+i, ptr2+i+1));
				ptr1++; ptr2++;
				if(st.charAt(ptr1-1)=='1')n1--;
				if(st.charAt(ptr2)=='1')n1++;
				//pw.println("m1- "+n1);pw
				
				if(n1>max)max=n1;
				if(max==k){return k;}
			}
			
			return max;
			
		}
			
		
		public static String shift(String A)
		{
			char lc = A.charAt(A.length()-1);
			return lc+A.substring(0,A.length()-1);
			
		}
		
	
		
		
		static  class Point 
		{
			long x,y;
	
			public Point(long a, long b)
			{
				x=a;
				y=b;
			}

			public int compareTo(Point o) {
				// TODO Auto-generated method stub
				return Long.compare(this.x, o.x);
				
			}

			
			
	
		}
	
		static class compx implements Comparator<Point>
		{
			public int compare(Point a, Point b)
			{
	
				if(a.x>b.x)return 1;
				if(a.x<b.x) return -1;
					
				return 0;
			}
		}
		
		static class compy implements Comparator<Point>
		{
			public int compare(Point a, Point b)
			{
	
				if(a.y>b.y)return 1;
				if(a.y<b.y) return -1;
					
				return 0;
			}
		}
	
		
		public static int lucky(long y)
		{
			
			long d = y;
			int flg=0;
			//long nd = (long)Math.floor(Math.log10((double)y));
			//pw.println(nd);
			for(;d>=1;d=d/10)
			{
				long dg = d%10;
				if(dg!=0)flg++;
				if(flg==2)return 0;
					
			}
			return 1;
			
		}
		
		public static int diff(Time n, Time k)
		{
			
			int hn=n.h,mn=n.m,sn=n.s;
			int hk=k.h,mk=k.m,sk=k.s;
			
			
			int tc=0,cs=0,cm=0,ch=0;
			if(sk>sn)
			{
				int o1 = sk-sn;
				int o2 = sn+60-sk;
				
				if(o1>o2)
				{ 
					cs=o2;
					mn--;
				}
				if(o2>o1)
				{
					cs=o1;
				}
				if(o1==o2)
				{
				
					int min1 = Math.min(Math.abs(mk-mn), 60 - Math.abs(mk-mn));
					int mn2 = mn-1;
					int min2  = Math.min(Math.abs(mk-mn2), 60 - Math.abs(mk-mn2));
					if(min2<min1)
					{
						cs=o2;
						mn--;
					}
					else
					{
						cs=o1;
					}
					
				}
			}
			
			if(sk<sn)
			{
				int o1 = sn-sk;
				int o2 = sk+60-sn;
				
				if(o1>o2)
				{ 
					cs=o2;
					mn++;
				}
				if(o2>o1)
				{
					cs=o1;
				}
				if(o1==o2)
				{
				
					int min1 = Math.min(Math.abs(mk-mn), 60 - Math.abs(mk-mn));
					int mn2 = mn+1;
					int min2  = Math.min(Math.abs(mk-mn2), 60 - Math.abs(mk-mn2));
					if(min2<min1)
					{
						cs=o2;
						mn++;
					}
					else
					{
						cs=o1;
					}
					
				}
			}
			
			if(mk>mn)
			{
				int o1 = mk-mn;
				int o2 = mn+60-mk;
				
				if(o1>o2)
				{ 
					cm=o2;
					hn--;
				}
				if(o2>o1)
				{
					cm=o1;
				}
				if(o1==o2)
				{
					int min1 = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
					int hn2 = hn-1;
					int min2  = Math.min(Math.abs(hk-hn2), 24 - Math.abs(hk-hn2));
					if(min2<min1)
					{
						cm=o2;
						hn--;
					}
					else
					{
						cm=o1;
					}
				}
			}
			
			if(mk<mn)
			{
				int o1 = mn-mk;
				int o2 = mk+60-mn;
				
				if(o1>o2)
				{ 
					cm=o2;
					hn++;
				}
				if(o2>o1)
				{
					cm=o1;
				}
				if(o1==o2)
				{
					int min1 = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
					int hn2 = hn+1;
					int min2  = Math.min(Math.abs(hk-hn2), 24 - Math.abs(hk-hn2));
					if(min2<min1)
					{
						cm=o2;
						hn++;
					}
					else
					{
						cm=o1;
					}
				}
			}
			
			ch = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
			tc=cs+cm+ch;
			return tc;
			
			
			
			//return 3;
		}
		
		
		
		public static class Time
		{
			int h,m,s;
			
			public Time(int x, int y, int z)
			{
				h=x; m=y; s=z;
				
			}
			
		}
		
		static class Pair
		{
		    int x;
		    int y;
		    
		    public Pair(int a , int b)
		    {
		        x=a;
		        y=b;
		    }
		    
		    
		}
		
		static class comp implements Comparator<Pair>
		{
		    
		    @Override
		    
		    public int compare(Pair a ,Pair b)
		    {
		        if(b.x>a.x)return -1;
		        if(b.x<a.x)return 1;
		        return 0;
		        
		    }
		    
		}
		static class compv implements Comparator<Vouch>
		{
		    
		    @Override
		    
		    public int compare(Vouch a ,Vouch b)
		    {
		        if(b.c>a.c)return -1;
		        if(b.c<a.c)return 1;
		        return 0;
		        
		    }
		    
		}
			
		static class Vouch
		{
		   int l,r, c; 
		   
		    
		    public Vouch(int a ,int b, int ci)
		    {
		        l=a;
		        r=b;
		        c=ci;
		        
		    }
		    
		}
			
		
	
		
		
		public static int strStr(final String haystack, final String needle) {
			
			
			if(needle.equals("")) return -1;
		    if(haystack.equals("")&&needle.equals(""))return -1;
		
		    String temp="";
		    
		    int hl = haystack.length();
		    int nl = needle.length();
		    if(nl>hl) return -1;
		    int ret=-1;
	        String wind = haystack.substring(0,nl);
	        pw.println(wind);
	        if(wind.equals(needle)) return 0;
	        
	        for(int i=1;i<hl-nl;i++)
	        {
	            wind = wind.substring(1, wind.length());
	           
	            wind = wind+haystack.charAt(i+nl);
	            
	            pw.println(i+" "+wind);
	            if(wind.equals(needle)) 
	            {
	                ret=i; break;
	            }
	            
	        }
	        
	        return (ret==-1)?-1:ret;
	        
			    
			    
			}
		
		
		public static int diff(String a, String b)
		{
			int ret=0;
			for(int i=0;i<a.length();i++)
			{
				if(a.charAt(i)!=b.charAt(i))ret++;
			}
			return ret;
		}
		
		public static boolean inter(Vouch a, Vouch b)
		{
			//return true if there's intersection
			int s1 = a.l;
			int e1 = a.r;
			
			int s2 = b.l;
			int e2 = b.r;
			
			if(s1<s2)
			{
				if(e1>=s2)return true;
				else return false;
			}
			else if(s1>s2)
			{
				if(e2>=s1) return true;
				else return false;
			}
			else
			{
				return true;
			}
			
		
		}
		
		static class Com implements Comparator<Range>
		{
		    public int compare(Range a, Range b)
		    {
		         int ac=a.x; int bc=b.x;
		         if(ac>bc)return 1;
		          if(ac<bc)return -1;
		          return 0;
		         
		         
		    }
		     
		}
		static class Range
		{
		    int x,y,z;
		    
		    public Range(int a, int b,int c)
		    {
		        x=a;
		        y=b;
		        z=c;
		    }
		    
		}
		
		static ArrayList<Integer> pr;
		public static void main(String[] args) {
	
          int ct=0;
          String ans="";
          int g = sc.nextInt();
          String s = sc.nextLine();
          int n = s.length();
          for(int i=0;i<n;i++)
          {
               char ch = s.charAt(i);
               if(ch=='1')ct++;
               else
               {
                    ans+=Integer.toString(ct);
                    ct=0;
               }
               
               
          }
          
          if(ct>=0) ans+=Integer.toString(ct);
          pw.println(ans);
          
      
          	/*
	     String st = sc.nextLine();
	     
	     Stack<Character> stk = new Stack<Character>();
	     stk.push(st.charAt(0));
	     for(int i=1;i<st.length();i++)
	     {
	                    
	                    
	                    
	                    
	                    char cc = st.charAt(i);
	                    
	                    if(stk.isEmpty())
	                    {
	                       stk.push(cc);  
	                    }
	               else
	               {
	                    
	                    if(cc=='('||cc=='{'||cc=='[') stk.push(cc);  
	                    
	                    
	                    
	                    
	                    
	                    char pr = stk.peek();
	                    if(cc==')')
	                    {
	                         if(pr=='(')stk.pop();
	                         else stk.push(cc);
	                         
	                    }
	         
	          if(cc=='}')
	                    {
	                         if(pr=='{')stk.pop();
	                         else stk.push(cc);
	                         
	                    }
	                    
	                     if(cc==']')
	                    {
	                         if(pr=='[')stk.pop();
	                         else stk.push(cc);
	                         
	                    }
	               }
	          
	     }
	     if(stk.isEmpty())pw.println("B");
	     else pw.println("NB");
	     
	     while(!stk.isEmpty())pw.println(stk.pop());
	     */
	     
	     
		/*	
		int[] D = {4, 7, 4, 8, 4, 1}; 
        int[] arr = {2,4,5,5,6,9,11,11,13};
        
        int l=0;
        int r =arr.length-1;
        int sr=12;
        int mid=0;
        int flg=0;
        while(l<=r)
        {
             mid=(l+r)/2;
             if(arr[mid]>sr)r=mid-1;
              if(arr[mid]<sr)l=mid+1;
               if(arr[mid]==sr)
               {
                    flg=1;
                    break;
               }
             
             
             
        }
       */
        //pw.println(l+" "+r);
        
        /*
          int[] ar= {2,1,5,3,4,8,7};
          Stack<Integer> st =new  Stack<Integer>();
          
          for(int i=0;i<ar.length-1;i++)
          {
               if(st.isEmpty())
               {
                   st.push(ar[i]); 
                    
               }
               else
               {
                    while(!st.isEmpty()&&st.peek()<ar[i])
                    {
                         int g=st.pop();
                         pw.println(g+"--< "+ar[i]);
                       if(ar[i]==8)
                       {
                            pw.println(g);
                       }
                    }
                    st.push(ar[i]);
                    
               }
               
          }
        
        while(!st.isEmpty())
        {
            pw.println(st.pop()+"--< -1");  
             
        }
        */
       /* int x,y;
        x=sc.nextInt();
        y=sc.nextInt();
        
        int[][] arr = new int[x][y];
        
        
        for(int i=0;i<x;i++)
        {
             for(int j=0;j<y;j++)
             {
                  arr[i][j]=sc.nextInt();
             }
        }
        
        
        PriorityQueue<Range> q = new PriorityQueue<Range>(new Com());
        
        for(int i=0;i<x;i++)
        {
             q.add(new Range(arr[i][0],i,0));
        }
        
        for(int i=0;i<x*y;i++)
        {
             Range p = q.poll();
             int ari = p.y;
               int oi = p.z;
             pw.println(p.x);
             
             if(arr[ari].length-1==oi)
             {
                  q.add(new Range(Integer.MAX_VALUE,-1,-1));
             }
             else 
             {
                  q.add(new Range(arr[ari][oi+1],ari,oi+1));
             }
             
        }
        
        */
        
         /* int[] P = {3, 5, 3, 8, 3, 6}; 
		
		int n = D.length;
		int pt = P[0];
	
		int st=0;
		int fst=st;
		int i=0;
		while(true)
		{
		    pw.println("st "+st+" i- "+i);
		     if(D[i]<=pt)
		     {
		          pt=pt-D[i]+P[(i+1)%6];
		          //i++;
		          i=(i+1)%6;
		          if(i==st)
		          {
		               pw.println("path from "+st);
		               break;
		          }
		     }
		     else
		     {
		          st=(i+1)%6;
		         i=st;
		         if(st==0)
		         {
		              pw.println("No path");
		              break;
		         }
		          pt=P[i];
		          
		          
		     }
		}
		*/	
			
			
			
			
			
			    pw.close();
			    
		}
	
		public static long getf(int x) {
			
			int xd=x;
			 long ans=0;
			 int lim = (int) Math.sqrt(xd);
			 for(int i=0;i<pr.size()&&pr.get(i)<=xd&&xd>1;i++)
			 {
			
				 int cpr = pr.get(i);
				// pw.println(i+"insi +"+x+" "+cpr);
				 if(xd%cpr==0)
				 {
					 while(xd%cpr==0)
					 {
						// pw.println(xd+" "+cpr);
						 ans++;
						 xd=xd/cpr;
					 }
					
				 }
			 }
			 return ans;
			 
			}
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
	}