#include <bits/stdc++.h>
using namespace std;
int main() {
  int nt1, nt2, p, d, x1, x2, t1, t2, s, dc;
  cin >> s >> x1 >> x2 >> t1 >> t2 >> p >> d;
  double v1, v2, t;
  v1 = 1.0 / t1;
  v2 = 1.0 / t2;
  if (x1 == x2) {
    cout << 0;
    return 0;
  }
  if (d == -1 && x2 > x1)
    dc = p + x1;
  else if (d == 1 && x1 > x2)
    dc = s - p + s - x1;
  else if (d == 1 && x2 > x1 && p > x1)
    dc = s - p + s + x1;
  else if (d == 1 && x2 > x1 && p <= x1)
    dc = x1 - p;
  else if (d == -1 && x2 < x1 && p < x1)
    dc = p + s + s - x1;
  else if (d == -1 && x2 < x1 && p >= x1)
    dc = p - x1;
  nt1 = dc * t1 + abs(x1 - x2) * t1;
  nt2 = abs(x1 - x2) * t2;
  if (nt1 >= nt2) {
    cout << nt2;
    return 0;
  }
  t = (dc * 1.0) / (v1 - v2);
  t += (abs(x1 - x2) - v2 * t) / v1;
  cout << t;
  return 0;
}
