#include <bits/stdc++.h>
using namespace std;
ifstream fin(".in");
ofstream fout(".out");
double second, x1, x2, t1, t2, p, d;
double vMan, vTram, vDiff, dDiff, dDist, parc, ans;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> second >> x1 >> x2;
  cin >> t1 >> t2;
  cin >> p >> d;
  if (x2 > x1) {
    if (d == -1) {
      dDiff = p + x1;
    } else {
      if (p > x1) {
        dDiff = second - p + second + x1;
      } else {
        dDiff = x1 - p;
      }
    }
    dDist = x2 - x1;
  } else {
    if (d == 1) {
      dDiff = second - p + second - x1;
    } else {
      if (p < x1) {
        dDiff = p + second + second - x1;
      } else {
        dDiff = p - x1;
      }
    }
    dDist = x1 - x2;
  }
  if (dDist * t2 < (dDiff + dDist) * t1) {
    cout << dDist * t2;
  } else {
    cout << (dDiff + dDist) * t1;
  }
}
