#include <bits/stdc++.h>
int m, n;
char ch[105][10005];
int p, q;
int main() {
  int i, j, k;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%s", ch[i] + 1);
  for (i = 1; i <= n; i++) {
    ch[i][0] = '#';
    ch[i][m + 1] = '#';
  }
  int y = 1, dir = 1;
  long long ans = 0;
  for (i = 1; i < n; i++) {
    int r = y, l = y, back = 0;
    while (1) {
      if (ch[i + 1][y] == '.') {
        ans++;
        break;
      }
      if (dir == 1) {
        if (ch[i][r + 1] == '.') {
          if (back == 1) {
            ans += r - l + 1;
            r++;
            y = r;
            back = 0;
          } else {
            ans++;
            r++;
            y = r;
          }
        } else if (ch[i][r + 1] == '+') {
          ch[i][r + 1] = '.';
          dir = -1;
          y = r;
          if (back == 1)
            ans += r - l + 1;
          else {
            back = 1;
            ans++;
          }
        } else {
          dir = -1;
          y = r;
          if (back == 1)
            ans += r - l + 1;
          else {
            back = 1;
            ans++;
          }
        }
      } else {
        if (ch[i][l - 1] == '.') {
          if (back == 1) {
            ans += r - l + 1;
            l--;
            y = l;
            back = 0;
          } else {
            ans++;
            l--;
            y--;
          }
        } else if (ch[i][l - 1] == '+') {
          ch[i][l - 1] = '.';
          dir = 1;
          y = l;
          if (back == 1)
            ans += r - l + 1;
          else {
            back = 1;
            ans++;
          }
        } else {
          dir = 1;
          y = l;
          if (back == 1)
            ans += r - l + 1;
          else {
            back = 1;
            ans++;
          }
        }
      }
      if (ch[i][l - 1] == '#' && ch[i][r + 1] == '#' && ch[i + 1][y] != '.') {
        printf("Never");
        return 0;
      }
    }
  }
  printf("%I64d", ans);
  getchar();
  getchar();
}
