#include <iostream>
using namespace std;

long long dp[60][2];

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin >> n;

	string s;
	dp[0][0] = dp[0][1] = 1;
	for (int i = 1; i <= n; ++i) {
		cin >> s;
		if (s[0] == 'A') {
			dp[i][0] = 2 * dp[i - 1][0] + dp[i - 1][1];
			dp[i][1] = dp[i - 1][1];
		}
		else {
			dp[i][0] = dp[i - 1][0];
			dp[i][1] = dp[i - 1][0] + 2 * dp[i - 1][1];
		}
	}
	cout << dp[n][1];
}
#include <bits/stdc++.h>
#define rep(i, n)	for(int i=0;i<(int)(n);i++)
#define ALL(a)	(a).begin(),(a).end()
using namespace std;
using ll=long long;
typedef pair<int,int> P;

struct STATE{

};

void init(STATE& state){
    
}

void modify(STATE& state){
    
}

int main(){
    rep(i,1000){
        int si,sj,ti,tj;
        cin>>si>>sj>>ti>>tj;
        string path;
        if(si<=ti) rep(j,ti-si) path+='D';
        else rep(j,si-ti) path+='U';
        if(sj<=tj) rep(j,tj-sj) path+='R';
        else rep(i,sj-tj) path+='L';
        cout<<path<<endl;
        flush(cout);
        int a;
        cin>>a;
    }
}