#include <bits/stdc++.h>
using namespace std;
int s, x1, x2, t1, t2, p, d, ans;
int main() {
  scanf("%d%d%d", &s, &x1, &x2);
  scanf("%d%d", &t1, &t2);
  scanf("%d%d", &p, &d);
  ans = abs(x2 - x1) * t2;
  if (t1 < t2) {
    int tim = 0;
    bool flag = 0;
    while (1) {
      if (p == x1) flag = 1;
      if (p == x2 && flag) break;
      if (p == 0 && d == -1) d = 1;
      if (p == s && d == 1) d = -1;
      tim += t1;
      p += d;
    }
    ans = min(ans, tim);
  }
  printf("%d\n", ans);
}
