#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, x1, x2;
  int t1, t2;
  int p, d;
  cin >> s >> x1 >> x2;
  cin >> t1 >> t2;
  cin >> p >> d;
  int ans1 = abs(x1 - x2) * t2;
  int ans2;
  if (x2 > x1) {
    if (d == 1) {
      if (p <= x1)
        ans2 = (x2 - p) * t1;
      else
        ans2 = (s - p + s + x2) * t1;
    } else
      ans2 = (p + x2) * t1;
  } else {
    if (d == -1) {
      if (p >= x1)
        ans2 = (p - x2) * t1;
      else
        ans2 = (p + s + s - x2) * t1;
    } else
      ans2 = (s - p + s - x2) * t1;
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
