#include <bits/stdc++.h>
using namespace std;
int main() {
  double s, x1, x2;
  cin >> s >> x1 >> x2;
  double t1, t2;
  cin >> t1 >> t2;
  double p, d;
  cin >> p >> d;
  double igorTime = abs(x2 - x1) * t2, igorDir = (x2 - x1) / abs(x2 - x1),
         tramTime, val = (d == 1 ? s : 0), otherVal = (d == 1 ? 0 : s);
  if (t1 >= t2) {
    cout << igorTime;
  } else {
    if (igorDir * d == -1) {
      tramTime = (abs(p - val) + abs(x2 - val)) * t1;
    } else if ((d == 1 && p <= x1) || (d == -1 && p >= x1)) {
      tramTime = abs(x2 - p) * t1;
    } else {
      tramTime = (abs(p - val) + s + abs(x2 - otherVal)) * t1;
    }
    cout << min(igorTime, tramTime);
  }
  return 0;
}
