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