#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, x1, x2, t1, t2, p, d;
  cin >> s >> x1 >> x2 >> t1 >> t2 >> p >> d;
  int ans = abs(x1 - x2) * t2;
  int dir = x1 < x2 ? 1 : -1;
  if ((p <= x1 && dir == 1 && d == 1) || (x1 <= p && dir == -1 && d == -1)) {
    ans = min(ans, abs(x2 - p) * t1);
  } else if ((p > x1 && dir == 1 && d == 1)) {
    ans = min(ans, abs(p - s) * t1 + s * t1 + x2 * t1);
  } else if (p < x1 && dir == -1 && d == -1) {
    ans = min(ans, p * t1 + s * t1 + abs(x2 - s) * t1);
  } else if (dir == -1 && d == 1) {
    ans = min(ans, abs(s - x2) * t1 + abs(s - p) * t1);
  } else if (dir == 1 && d == -1) {
    ans = min(ans, p * t1 + x2 * t1);
  }
  cout << ans << "\n";
}
