#include <bits/stdc++.h>
using namespace std;
const int INFint = 2e9;
const long long INF = 2e18;
const int MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  vector<vector<char> > f(n, vector<char>(m));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> f[i][j];
    }
  }
  int evnetY = 0;
  int x = 0, y = 0;
  long long ans = 0;
  int dy = 1;
  int bad = 0;
  while (x < n - 1) {
    if (f[x + 1][y] == '.') {
      evnetY = y;
      x++;
      bad = 0;
      ans++;
      continue;
    }
    if (y + dy > -1 && y + dy < m && f[x][y + dy] == '.') {
      y += dy;
      ans++;
      continue;
    }
    if (y + dy > -1 && y + dy < m && f[x][y + dy] == '+') {
      bad = 0;
      f[x][y + dy] = '.';
      swap(y, evnetY);
      dy *= -1;
      ans += abs(evnetY - y);
      ans++;
      continue;
    }
    bad++;
    swap(y, evnetY);
    ans++;
    dy *= -1;
    ans += abs(evnetY - y);
    if (bad > 42) {
      cout << "Never";
      return 0;
    }
  }
  cout << ans;
  fprintf(stderr, "\nTIME = %lf\n", 1.0 * clock() / CLOCKS_PER_SEC);
  ;
  return 0;
}
