#include <bits/stdc++.h>
using namespace std;
int a[100000];
int main() {
  int s, x1, x2, t1, t2, p, d;
  cin >> s >> x1 >> x2 >> t1 >> t2 >> p >> d;
  int res = (x1 - x2) * t2;
  if (res < 0) res = -res;
  if (x2 > x1) {
    if (d == -1) {
      int tmp = (p + x1 + x2 - x1) * t1;
      res = min(res, tmp);
    } else {
      if (p > x1) {
        int tmp = (s - p + s + x2) * t1;
        res = min(res, tmp);
      } else {
        int tmp = (x2 - p) * t1;
        res = min(res, tmp);
      }
    }
  } else {
    if (d == 1) {
      int tmp = (s - p + s - x2) * t1;
      res = min(res, tmp);
    } else {
      if (p < x1) {
        int tmp = (p + s + s - x2) * t1;
        res = min(tmp, res);
      } else {
        int tmp = (p - x2) * t1;
        res = min(tmp, res);
      }
    }
  }
  cout << res << endl;
  return 0;
}
