#include <bits/stdc++.h>
using namespace std;
int s, x1, x2, t1, t2, p, d;
int go(int p, int& d, int x) {
  int ans = 0;
  int dd = (x - p);
  if (dd * d < 0) {
    int to = (d > 0) ? s : 0;
    ans += 2 * abs(to - p) * t1;
    d *= -1;
  }
  ans += abs(x - p) * t1;
  return ans;
}
int main() {
  assert(cin >> s >> x1 >> x2 >> t1 >> t2 >> p >> d);
  int ans1 = abs(x1 - x2) * t2;
  int ans2 = go(p, d, x1) + go(x1, d, x2);
  cout << min(ans1, ans2) << endl;
  return 0;
}
