#include <bits/stdc++.h>
using namespace std;
int n, s, x1, x2, v1, v2, w, d, ans;
int main() {
  cin >> s >> x1 >> x2 >> v1 >> v2 >> w >> d;
  ans = abs(x1 - x2) * v2;
  if (d == 1) {
    if (w < x2) {
      if (x1 < x2) {
        if (x1 >= w)
          ans = min(ans, (x2 - w) * v1);
        else
          ans = min(ans, (2 * s + x2 - w) * v1);
      } else
        ans = min(ans, (2 * s - x2 - w) * v1);
    } else {
      if (x1 > x2)
        ans = min(ans, (2 * s - x2 - w) * v1);
      else
        ans = min(ans, (2 * s + x2 - w) * v1);
    }
  } else {
    if (w < x2) {
      if (x1 > x2)
        ans = min(ans, (2 * s - x2 + w) * v1);
      else
        ans = min(ans, (x2 + w) * v1);
    } else {
      if (x1 < x2)
        ans = min(ans, (x2 + w) * v1);
      else {
        if (x1 <= w)
          ans = min(ans, (w - x2) * v1);
        else
          ans = min(ans, (2 * s + w - x2) * v1);
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
