#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 mn = abs(x1 - x2) * t2;
  if (p == x1) {
    if (d == 1) {
      int t = 0;
      if (x1 < x2)
        t += abs(x1 - x2) * t1;
      else
        t += abs(s - x1) * t1 + abs(s - x2) * t1;
      mn = min(mn, t);
    } else {
      int t = 0;
      if (x2 < x1)
        t += abs(x1 - x2) * t1;
      else
        t += abs(0 - x1) * t1 + abs(0 - x2) * t1;
      mn = min(mn, t);
    }
  } else if (p < x1) {
    if (d == 1) {
      int t = abs(x1 - p) * t1;
      if (x1 < x2)
        t += abs(x1 - x2) * t1;
      else
        t += abs(s - x1) * t1 + abs(s - x2) * t1;
      mn = min(mn, t);
    } else {
      int t = p * t1 + x1 * t1;
      if (x1 < x2)
        t += abs(x1 - x2) * t1;
      else
        t += abs(s - x1) * t1 + abs(s - x2) * t1;
      mn = min(mn, t);
    }
  } else {
    if (d == 1) {
      int t = abs(x1 - s) * t1 + abs(s - p) * t1;
      if (x2 < x1)
        t += abs(x1 - x2) * t1;
      else
        t += x1 * t1 + x2 * t1;
      mn = min(mn, t);
    } else {
      int t = abs(p - x1) * t1;
      if (x2 < x1)
        t += abs(x1 - x2) * t1;
      else
        t += x1 * t1 + x2 * t1;
      mn = min(mn, t);
    }
  }
  cout << mn << endl;
}
