#include <bits/stdc++.h>
using namespace std;
const int N = 300000;
int i, j, n, k, f1, f2, ans, m, t, p, cur, flag;
int f[N], g[N];
void init() {
  int x1, x2, x0, t1, t2, d, s, ans;
  scanf("%d%d%d%d%d%d%d", &s, &x1, &x2, &t1, &t2, &x0, &d);
  ans = fabs(x1 - x2) * t2;
  if (t1 >= t2) {
    printf("%d\n", ans);
    return;
  }
  int cx = x0, cd = d, cmeet;
  cur = 0;
  flag = 0;
  for (i = 1; i <= 5; i++) {
    while (cx != x2) {
      cur += t1;
      cx = cx + cd;
      if (cx == 0 || cx == s) cd *= -1;
    }
    f[i] = cur;
    cur += t1;
    cx = cx + cd;
    if (cx == 0 || cx == s) cd *= -1;
  }
  if (x1 == x0)
    cmeet = 0;
  else if ((x0 < x1) ^ (d == 1)) {
    if (d == -1)
      cmeet = x0 + x1;
    else
      cmeet = s * 2 - x0 - x1;
  } else
    cmeet = fabs(x0 - x1);
  for (i = 1; i <= 5; i++)
    if (cmeet * t1 * t2 <= f[i] * (t1 + t2)) {
      if (f[i] < ans) ans = f[i];
      break;
    }
  printf("%d\n", ans);
}
void work() {}
int main() {
  init();
  work();
  return 0;
}
