#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;
  if (x1 > x2) {
    x1 = s - x1;
    x2 = s - x2;
    p = s - p;
    d = -d;
  }
  int ans = (x2 - x1) * t2;
  if (d == -1)
    ans = min(ans, t1 * (p + x2));
  else {
    if (p <= x1)
      ans = min(ans, t1 * (x2 - p));
    else
      ans = min(ans, t1 * (2 * s - p + x2));
  }
  cout << ans << endl;
  return 0;
}
