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