#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <class T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
inline int nxt() {
  int wow;
  scanf("%d", &wow);
  return wow;
}
inline long long int lxt() {
  long long int wow;
  scanf("%lld", &wow);
  return wow;
}
inline double dxt() {
  double wow;
  scanf("%lf", &wow);
  return wow;
}
int main() {
  int s = nxt(), x1 = nxt(), x2 = nxt();
  int t2 = nxt(), t1 = nxt();
  int p = nxt(), d = nxt();
  int walk, tram;
  if (x2 > x1) {
    walk = t1 * (x2 - x1);
    if (d == 1) {
      if (p <= x1)
        tram = (x2 - p) * t2;
      else
        tram = (2 * s + x2 - p) * t2;
    } else
      tram = (x2 + p) * t2;
  }
  if (x2 < x1) {
    walk = t1 * (x1 - x2);
    if (d == -1) {
      if (p >= x1)
        tram = (p - x2) * t2;
      else
        tram = (p + s + s - x2) * t2;
    } else
      tram = (s - x2 + s - p) * t2;
  }
  cout << min(walk, tram) << endl;
  return 0;
}
