#include <bits/stdc++.h>
using namespace std;
template <class T>
T power(T N, T P) {
  return (P == 0) ? 1 : N * power(N, P - 1);
}
template <class T>
T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
T lcm(T a, T b) {
  return (a / gcd(a, b)) * b;
}
int main() {
  int n, s, d, t1, t2, train, dir;
  cin >> n >> s >> d >> t1 >> t2 >> train >> dir;
  int flag[n + 100];
  int time[n + 100];
  memset(flag, 0, sizeof flag);
  memset(time, 0, sizeof time);
  int i = train;
  int cnt = 0;
  int need = d - s;
  if (need < 0)
    need = -1;
  else
    need = 1;
  while ((flag[s] != need || flag[d] != need)) {
    if (i == s) flag[s] = dir;
    if (i == d) flag[d] = dir;
    if (dir == -1) {
      if (i > 0) {
        time[i] = cnt;
        cnt += t1;
        i--;
      } else {
        time[i] = cnt;
        dir = 1;
      }
    } else if (dir == 1) {
      if (i < n) {
        time[i] = cnt;
        cnt += t1;
        i++;
      } else {
        time[i] = cnt;
        dir = -1;
      }
    }
  }
  int ans1 = abs(s - d) * t2;
  int ans2 = time[d];
  printf("%d\n", min(ans1, ans2));
}
