#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 10;
const int LEFT = -1;
const int RIGHT = +1;
const int inf = 1e9 + 7;
int s, x1, x2, t1, t2, p, dt;
int compute(int x, int di, int p) {
  if (di == 1 && p <= x) return x - p;
  if (di == 1) return 2 * s - p + x;
  return p + x;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s >> x1 >> x2 >> t1 >> t2 >> p >> dt;
  if (t2 <= t1) return cout << abs(x2 - x1) * t2 << endl, 0;
  int train_start_time = 0;
  if (x2 >= x1)
    train_start_time = compute(x1, dt, p);
  else
    train_start_time = compute(s - x1, dt * -1, s - p);
  cout << min(train_start_time * t1 + abs(x2 - x1) * t1, abs(x2 - x1) * t2)
       << endl;
  return 0;
}
