#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 7, oo = 1e9 + 7, OO = 1e18 + 7;
long long s, x1, x2, t1, t2, p, d, ans;
int main() {
  cin >> s >> x1 >> x2 >> t1 >> t2 >> p >> d;
  ans = abs(x1 - x2) * t2;
  if (x1 < x2) {
    if (0 < d) {
      if (p <= x1)
        ans = min(ans, (x2 - p) * t1);
      else
        ans = min(ans, (2 * s - p + x2) * t1);
    } else {
      ans = min(ans, (p + x2) * t1);
    }
  }
  if (x2 < x1) {
    if (0 < d) {
      ans = min(ans, (2 * s - p - x2) * t1);
    } else {
      if (x1 <= p)
        ans = min(ans, (p - x2) * t1);
      else
        ans = min(ans, (p + s * 2 - x2) * t1);
    }
  }
  cout << ans;
  return 0;
}
