Algorithm


B. Borze
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Borze code, i.e. to find out the ternary number given its representation in Borze alphabet.

Input

The first line contains a number in Borze code. The length of the string is between 1 and 200 characters. It's guaranteed that the given string is a valid Borze code of some ternary number (this number can have leading zeroes).

Output

Output the decoded ternary number. It can have leading zeroes.

Examples
input
Copy
.-.--
output
Copy
012
input
Copy
--.
output
Copy
20
input
Copy
-..-.--
output
Copy
1012



 

Code Examples

#1 Code Example with C++ Programming

Code - C++ Programming

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


#define ll long long
#define endl '\n'
#define debug(n) cout<<(n)<<endl;
const ll INF = 2e18 + 99;

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  string s, res = "";
  cin>>s;
  for(int i = 0; i < s.length(); i++){
    if(s[i] == '.'){
      res += '0';
    }
    else if(s[i] == '-'){
      i++;
      if(s[i] == '.'){
        res += '1';
      }
      else{
        res += '2';
      }
    }
  }
  cout<<res<<endl;

}
Copy The Code & Try With Live Editor

Input

x
+
cmd
.-.--

Output

x
+
cmd
012
Advertisements

Demonstration


Codeforcess Solution 32-B B. Borze ,C++, Java, Js and Python ,32-B,Codeforcess Solution

Previous
Codeforces solution 1080-B-B. Margarite and the best present codeforces solution
Next
CodeChef solution DETSCORE - Determine the Score CodeChef solution C,C+