#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int s, x1, x2, p, d, t1, t2;
  cin >> s >> x1 >> x2 >> t1 >> t2 >> p >> d;
  int ans;
  if (x1 < x2) {
    if (d == 1 && x1 >= p) ans = min(t1 * (x2 - p), (x2 - x1) * t2);
    if (d == 1 && x1 < p) ans = min((2 * s - p + x2) * t1, t2 * (x2 - x1));
    if (d == -1) ans = min((p + x2) * t1, (x2 - x1) * t2);
  } else {
    if (d == -1 && p >= x1) ans = min(t1 * (p - x2), t2 * (x1 - x2));
    if (d == -1 && p < x1) ans = min(t1 * (2 * s + p - x2), t2 * (x1 - x2));
    if (d == 1) ans = min(t1 * (2 * s - p - x2), (x1 - x2) * t2);
  }
  cout << ans;
  return 0;
}
