#include <bits/stdc++.h>
using namespace std;
const long long OO = 1e16;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
int s, x, xx;
int t, tt;
int p, d;
int main() {
  fast();
  cin >> s >> x >> xx >> tt >> t >> p >> d;
  int byf = abs(x - xx) * t;
  int byt = 0;
  if (d == -1 && p >= x) {
    byt = (p - x) * tt;
    if (xx - x < 0) {
      byt += abs(xx - x) * tt;
    } else {
      byt += (x + xx) * tt;
    }
  } else if (d == -1 && p < x) {
    byt = (p * tt) + (x * tt);
    if (xx - x < 0) {
      byt += (2 * s - (x + xx)) * tt;
    } else {
      byt += abs(xx - x) * tt;
    }
  } else if (d == 1 && p > x) {
    byt = (s - p + s - x) * tt;
    if (xx - x < 0) {
      byt += (x - xx) * tt;
    } else {
      byt += (x + xx) * tt;
    }
  } else if (d == 1 && p <= x) {
    byt = (x - p) * tt;
    if (xx - x < 0) {
      byt += (s - x + s - xx) * tt;
    } else {
      byt += abs(x - xx) * tt;
    }
  }
  cout << min(byt, byf) << endl;
  return 0;
}
