#include <bits/stdc++.h>
using namespace std;
int main() {
  long long s, x1, x2;
  cin >> s >> x1 >> x2;
  long long t1, t2;
  cin >> t1 >> t2;
  long long p, d;
  cin >> p >> d;
  if (x1 == x2) {
    cout << 0;
    return (0);
  }
  long long o1(1000000), o2(10000000), d2(1);
  o1 = abs(x1 - x2) * t2;
  long long tmp;
  if (x2 < x1) d2 = -1;
  if (0 == 1)
    o2 = abs(p - x2) * t1;
  else {
    o2 = 0;
    bool f(1);
    while (p != x2 or f) {
      if (p == x1) f = 0;
      if (p == 0 or p == s) d *= -1;
      p += d;
      o2 += t1;
    }
  }
  cout << min(o1, o2);
}
