#include <bits/stdc++.h>
using namespace std;
int main() {
  int p, d, s, x1, x2, t1, t2, ans = INT_MAX;
  cin >> s >> x1 >> x2;
  cin >> t1 >> t2;
  cin >> p >> d;
  if (t1 >= t2) {
    printf("%d", (abs(x1 - x2) * t2));
    return 0;
  }
  ans = (abs(x1 - x2) * t2);
  int onbus = 0, ans2 = 0;
  while (1) {
    if (p == x1) {
      onbus = 1;
    }
    ans2 += t1;
    p += d;
    if (p < 0) {
      d = -d;
      p = 1;
    } else if (p > s) {
      p = s - 1;
      d = -d;
    }
    if (onbus && p == x2) {
      break;
    }
  }
  printf("%d", min(ans, ans2));
  return 0;
}
