// NOTE: it is recommended to use this even if you don't understand the following code.

#include <fstream>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
    // uncomment the two following lines if you want to read/write from files
    // ifstream cin("input.txt");
    // ofstream cout("output.txt");

    int Dx, Dy, Ds;
    cin >> Dx >> Dy >> Ds;

    int Bx, By, Bs;
    cin >> Bx >> By >> Bs;

    char dir;
    cin >> dir;

    int T = 0;


    // INSERT YOUR CODE HERE


    cout << T << endl;

    return 0;
}
