#include <bits/stdc++.h>
using namespace std;
int xd[] = {0, 1, 0, -1};
int yd[] = {1, 0, -1, 0};
int xx[] = {0, 1, 0, -1, 1, -1, 1, -1};
int yy[] = {1, 0, -1, 0, 1, 1, -1, -1};
int kx[] = {-2, -1, -2, -1, 1, 2, 2, 1};
int ky[] = {1, 2, -1, -2, -2, -1, 1, 2};
bool islucky(int x) {
  int four = 0, seven = 0;
  while (x) {
    if (x % 10 != 7 && x % 10 != 4) return false;
    if (x % 10 == 7)
      seven++;
    else
      four++;
    x = x / 10;
  }
  return four == seven;
}
bool is_prime(long long x) {
  if (x == 1) return false;
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
}
long long C(int k, int l) {
  if (l == k) return 1;
  if (l * 2 > k) l = k - l;
  long long res = 1, temp = l;
  for (int i = k - l + 1; i <= k; i++) {
    res *= i / temp;
    temp--;
  }
  return res;
}
long long string2num(string s) {
  long long ans = 0;
  for (int i = 0; i < s.length(); i++) {
    ans *= 10;
    ans += s[i] - '0';
  }
  return ans;
}
long long sumOfDigit(int x) {
  int res = 0;
  while (x) {
    res += x % 10;
    x /= 10;
  }
  return res;
}
uint64_t bigPow(uint64_t base, uint64_t p) {
  uint64_t temp = 1;
  while (p--) {
    temp *= base;
  }
  return temp;
}
vector<int> soso;
bool prime[10000001] = {0};
void SieveOfEratosthenes(int n) {
  soso.push_back(2);
  for (int p = 3; p * p <= n; p += 2) {
    if (prime[p] == false) {
      for (int i = p * 2; i <= n; i += p) prime[i] = true;
    }
  }
  for (int i = 3; i <= n; i += 2)
    if (!prime[i]) soso.push_back(i);
}
int gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
bool valid(long long i, long long j, long long n, long long m) {
  if (i >= 0 && i < n && j >= 0 && j < m) return true;
  return false;
}
bool issquare(long long num) {
  for (int i = 1; i * i <= num; i++) {
    if (i * i == num) return true;
  }
  return false;
}
vector<int> pset;
void initSet(int n) {
  pset = vector<int>(n, 0);
  for (int i = 0; i < n; i++) pset[i] = i;
}
int findSet(int i) { return (pset[i] == i) ? i : (pset[i] = findSet(pset[i])); }
bool sameSet(int i, int j) { return findSet(i) == findSet(j); }
void unionSet(int i, int j) { pset[findSet(i)] = findSet(j); }
int main() {
  ios::sync_with_stdio(false);
  long long s, x1, x2, t1, t2, p, d;
  cin >> s >> x1 >> x2 >> t1 >> t2 >> p >> d;
  long long igor_time = abs(x1 - x2) * t2;
  long long tram_time = 1000000;
  if (x2 < x1) {
    if (d == -1) {
      if (p >= x1) {
        tram_time = (p - x2) * t1;
      } else {
        tram_time = p * t1 + s * t1 + (s - x2) * t1;
      }
    } else {
      tram_time = (s - p) * t1 + (s - x2) * t1;
    }
  } else {
    if (d == 1) {
      if (p <= x1) {
        tram_time = abs(p - x2) * t1;
      } else {
        tram_time = (s - p) * t1 + (s)*t1 + x2 * t1;
      }
    } else {
      tram_time = (p)*t1 + (x2)*t1;
    }
  }
  cout << min(igor_time, tram_time);
}
