#include <iostream>

using namespace std;

#define MAX 250

int n, k;
string s;
int x[MAX], y[MAX];

int main( void ) {
    cin >> n >> s;
    for( int i = 0; i < s.size(); ++i ) {
        x[i+1] = x[i];
        y[i+1] = y[i];
        if( s[i] == 'L' ) --x[i+1];
        if( s[i] == 'R' ) ++x[i+1];
        if( s[i] == 'D' ) --y[i+1];
        if( s[i] == 'U' ) ++y[i+1];
    }
    cin >> k;

    int ret = 0;
    for( int i = 0; i+k < n; ++i )
        if( abs(x[i]-x[i+k]) <= 1 && abs(y[i]-y[i+k]) <= 1 )
            ++ret;
            
    cout << ret << endl;

    return 0;
}
