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