#include <bits/stdc++.h>
using namespace std;
const int MIN = 1e3 + 2;
const int MXN = 1e6 + 3;
const int INF = 1e9 + 7;
const long long LINF = 1e18 + 15;
const double EPS = 1e-9;
int s, x1, x2;
int t1, t2;
int p, d;
int main() {
  cin >> s >> x1 >> x2;
  cin >> t1 >> t2;
  cin >> p >> d;
  if (x1 <= x2) {
    if (p <= x1) {
      if (d == 1) {
        cout << min((x2 - x1) * t2, (x2 - p) * t1);
        cerr << " " << 1;
        return 0;
      }
      cout << min((x2 - x1) * t2, (x2 + p) * t1);
      cerr << " " << 2;
      return 0;
    }
    if (d == 1) {
      cout << min((x2 - x1) * t2, (s - p + s + x2) * t1);
      cerr << " " << 3;
      return 0;
    }
    cout << min((x2 - x1) * t2, (x2 + p) * t1);
    cerr << " " << 4;
    return 0;
  }
  if (p >= x1) {
    if (d == 1) {
      cout << min((x1 - x2) * t2, (s - x2 + s - p) * t1);
      cerr << " " << 5;
      return 0;
    }
    cout << min((x1 - x2) * t2, (p - x2) * t1);
    cerr << " " << 6;
    return 0;
  }
  if (d == 1) {
    cout << min((x1 - x2) * t2, (s - x2 + s - p) * t1);
    cerr << " " << 7;
    return 0;
  }
  cout << min((x1 - x2) * t2, (s + p + s - x2) * t1);
  cerr << " " << 8;
  return 0;
}
