#include <bits/stdc++.h>
using namespace std;
const int M = 2e5 + 5;
ostream &operator<<(ostream &oov, const vector<long long> &a) {
  for (int i = 0; i < a.size(); i++) {
    oov << a[i] << " ";
  }
  return oov;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  double s, x1, x2, t1, t2, d, p, des, mt1, mt2;
  cin >> s >> x1 >> x2 >> t1 >> t2 >> p >> d;
  if (x2 > x1) {
    if (d == -1.00)
      des = p + x2;
    else if (p <= x1)
      des = x2 - p;
    else
      des = 2 * s - p + x2;
  } else {
    if (d == 1.00)
      des = 2 * s - p - x2;
    else if (p >= x1)
      des = p - x2;
    else
      des = p + s + s - x2;
  }
  mt1 = des * t1;
  mt2 = abs(x2 - x1) * t2;
  cout << min(mt1, mt2);
  return 0;
}
