#include <bits/stdc++.h>
using namespace std;
const int MX = 2e6 + 10;
const int mod = 1e9 + 7;
const long long int inf = 1LL << 62;
int dx4[] = {0, 0, -1, 1};
int dy4[] = {1, -1, 0, 0};
int dx[] = {1, 1, 1, 0, 0, -1, -1, -1};
int dy[] = {1, 0, -1, 1, -1, 1, 0, -1};
int main() {
  long long int n, x1, x2, t1, t2, p, d;
  scanf("%lld %lld %lld", &n, &x1, &x2);
  scanf("%lld %lld", &t1, &t2);
  scanf("%lld %lld", &p, &d);
  long long int mn = inf;
  if (t2 <= t1) {
    cout << (t2 * abs(x1 - x2)) << endl;
    return 0;
  }
  mn = min(mn, t2 * abs(x1 - x2));
  if (x1 < x2) {
    if (d == 1) {
      if (p <= x1) {
        mn = min(mn, abs(p - x2) * t1);
      } else {
        mn = min(mn, t1 * (n + n - p + x2));
      }
    } else {
      mn = min(mn, t1 * (p + x2));
    }
  } else {
    if (d == 1) {
      mn = min(mn, (-p + n + n - x2) * t1);
    } else {
      if (p < x1) {
        mn = min(mn, (p + n + n - x2) * t1);
      } else {
        mn = min(mn, abs(p - x2) * t1);
      }
    }
  }
  cout << (mn) << endl;
  return 0;
}
