#include <bits/stdc++.h>
using namespace std;
const int INFINITE = 100000000;
const int MAXN = 110;
string a[MAXN];
int p[2][MAXN][MAXN * 100];
int td[2] = {1, -1};
int n, m;
int next(int *p, int c) {
  if (p[c] == c) return p[c];
  p[c] = next(p, p[c]);
  return p[c];
}
int main() {
  scanf("%d%d", &n, &m);
  m += 2;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i] = '#' + a[i] + '#';
    for (int j = 1; j <= m - 1; j++) p[0][i][j] = p[1][i][j] = j;
  }
  long long step = 0;
  int row = 0, col = 1, d = 0;
  int fuck = 0;
  while (row < n - 1) {
    fuck++;
    if (fuck >= 10000000) {
      printf("Never\n");
      return 0;
    }
    if (a[row + 1][col] == '.') {
      step++;
      row++;
      continue;
    }
    int newcol = col + td[d];
    if (a[row][newcol] == '.') {
      int precol = col;
      p[d][row][col] = newcol;
      col = next(p[d][row], col);
      step += fabs(precol - col);
      continue;
    }
    if (a[row][newcol] == '+') a[row][newcol] = '.';
    d = 1 - d;
    step++;
  }
  cout << step << endl;
  return 0;
}
