#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using ld = long double;
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define JUGAD freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pb push_back
#define po pop_back
#define pof pop_front
#define eb emplace_back
#define pf push_front
#define mp make_pair
#define pii pair<int,int>
#define pll pair<lli,lli>
#define pdd pair<ld,ld>
#define pq priority_queue
#define qq queue
#define ff first
#define ss second	
#define decimal fixed<<setprecision(20)

const int N = 1e5+3;
const lli MOD = 1e9+7;

lli gcd(lli a,lli b){
	if(a==0){return b;}
	return gcd(b%a,a);
}

lli binpow(lli a, lli b){
	lli res=1;
	while(b){
		if(b&1){res*=a;}
		a*=a;
		b>>=1;
	}
	return res;
}

void solve(){
	string s;cin>>s;
	int ar[10];
	for(int i=0;i<10;i++){
		if(s[i]=='o'){
			ar[i]=1;
		}
		else if(s[i]=='x'){ar[i]=0;}
		else{ar[i]=2;}
	}
	int ans=0;
	for(int i=0;i<10;i++){
		for(int j=0;j<10;j++){
			for(int k=0;k<10;k++){
				for(int l=0;l<10;l++){
					bool ok=1;
					for(int a=0;a<10;a++){
						if(ar[a]==1){
							if(i!=a && j!=a && k!=a && l!=a){
								ok=0;break;
							}
						}
						else if(ar[a]==0){
							if(i==a || j==a || k==a || l==a){
								ok=0;break;
							}
						}
					}
					if(ok){ans++;}
				}
			}
		}
	}
	cout<<ans;
}

int main(){	
	FAST;	
	solve();
	return 0;
	int test_cases;cin>>test_cases;
	for(int tc=1;tc<=test_cases;tc++){
		
		cout<<"Case #"<<tc<<": ";
	}
} 			
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007LL
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define SHIFT(n) (1LL<<((ll)n))
#define ALL(a) (a).begin(),(a).end()
#define Max(a) (*max_element(ALL(a)))
#define Min(a) (*min_element(ALL(a)))
#define Sum(a) (accumulate(ALL(a),0LL))
using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    deque<char>deq;
    ll fl = false;
    for(auto c:s){
        if(c == 'R'){
            fl++;
            fl %= 2;
        }else{
            if(fl){
                if(!deq.empty() && deq.front() == c){
                    deq.pop_front();
                }else{
                    deq.push_front(c);
                }
            }else{
                if(!deq.empty() && deq.back() == c){
                    deq.pop_back();
                }else{
                    deq.push_back(c);
                }
            }
        }
    }
    if(fl){
        while(!deq.empty()){
            cout << deq.back();
            deq.pop_back();
        }
    }else{
        while (!deq.empty()){
            cout << deq.front();
            deq.pop_front();
        }
    }
    cout << endl;
    return 0;
}