#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  long long s, x1, x2;
  cin >> s >> x1 >> x2;
  long long t1, t2;
  cin >> t1 >> t2;
  long long p, d;
  cin >> p >> d;
  long long time = abs(x1 - x2);
  long long t = 0, egor = 0, yes = 0, res = 0;
  if (p == x1) egor = 1;
  while (1) {
    if (d == -1) {
      p -= 1;
      for (long long i = p; i >= 0; i--) {
        t += 1;
        if (i == x1) egor = 1;
        if (egor && i == x2) yes = 1;
        if (egor && yes) {
          res = t;
          break;
        }
      }
      p = 0, d = 1;
    }
    if (res) break;
    if (d == 1) {
      p += 1;
      for (long long i = p; i <= s; i++) {
        t += 1;
        if (i == x1) egor = 1;
        if (egor && i == x2) yes = 1;
        if (egor && yes) {
          res = t;
          break;
        }
      }
      p = s, d = -1;
    }
    if (res) break;
  }
  time *= t2;
  res *= t1;
  cout << min(time, res) << endl;
}
