#include <iostream>
using namespace std;
void ReadMoves(int &k, char *s){
    cin>>k;
      for(int i=0; i < k; ++i)
        cin>>s[i];
}
int Count(int nrROW, int nrCOL, int nrOfMoves, char *a){
    int count = 0;
    a[nrOfMoves];
      for(int i=0; i < nrOfMoves; ++i){
          if(a[i] == 'L'){
             count++;
             nrCOL--;
          }
          if(a[i] == 'R' && a[i - 1] == 'L'){
              nrCOL++;
          }
          if(a[i] == 'L' && a[i - 1] == 'R'){
              nrCOL++;
          }
          if(a[i] == 'R'){
            count++;
            nrCOL--;
          }
          if(a[i] == 'U'){
              count++;
              nrROW--;
          }
          if(a[i] == 'D' && a[i - 1] == 'U'){
              nrROW++;
          }
          if(a[i] == 'U' && a[i - 1] == 'D'){
              nrROW++;
          }
          if(a[i] == 'D'){
              count++;
              nrROW--;
          }
      }

    if(nrROW >=1 && nrCOL >= 1)
      return count;
    else
      return -1;

}
int main(){
    int nrROW, nrCOL, nrOfMoves;
    char moves[20];
    cin>>nrROW>>nrCOL;
    ReadMoves(nrOfMoves, moves);
    cout<<Count(nrROW, nrCOL, nrOfMoves, moves);
}