#include <bits/stdc++.h>
using namespace std;
int setBit(int n, int r) { return n | (1 << r); }
int resetBit(int n, int r) { return n & ~(1 << r); }
int checkBit(int n, int r) { return n & (1 << r); }
template <typename T>
T mod(T a, T b = 1000000007) {
  return (a % b) >= 0 ? (a % b) : (a % b) + b;
}
template <typename T>
T bigmod(T p, T e, T M) {
  T ret = 1;
  while (e > 0) {
    if (e % 2) ret = (ret * p) % M;
    p = (p * p) % M;
    e /= 2;
  }
  return ret;
}
template <typename T>
T power(T x, T y) {
  T ans = 1;
  while (y > 0) {
    if (y % 2) ans *= x;
    x *= x;
    y /= 2;
  }
  return ans;
}
template <typename T>
T gcd(T a, T b) {
  a = abs(a);
  b = abs(b);
  while (b != 0) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
template <typename T>
T lcm(T a, T b) {
  return a * (b / gcd(a, b));
}
template <typename T>
void read(T &result) {
  bool sgn = false;
  result = 0;
  char ch;
  ch = getchar();
  while (true) {
    if (ch == '-') break;
    if (ch >= '0' && ch <= '9') break;
    ch = getchar();
  }
  if (ch == '-')
    sgn = true;
  else
    result = ch - '0';
  while (true) {
    ch = getchar();
    if (ch < '0' || ch > '9') break;
    result = result * 10 + (ch - '0');
  }
  if (sgn) result = -result;
}
int s, x1, x2, t1, t2, p, d;
int main() {
  cin >> s >> x1 >> x2 >> t1 >> t2 >> p >> d;
  int best = t2 * abs(x2 - x1);
  int myd = x2 > x1 ? 1 : -1;
  if (d == 1 && myd == 1) {
    if (p <= x1)
      best = min(best, t1 * abs(x2 - p));
    else
      best = min(best, t1 * (abs(s - p) + s + x2));
  } else if (d == -1 && myd == 1) {
    best = min(best, t1 * (p + x2));
  } else if (d == 1 && myd == -1) {
    best = min(best, t1 * (abs(s - p) + abs(s - x2)));
  } else {
    if (p >= x1)
      best = min(best, t1 * abs(p - x2));
    else
      best = min(best, t1 * (p + s + abs(s - x2)));
  }
  cout << best;
}
