#include <bits/stdc++.h>
using namespace std;
const long long size = 100005;
const long long inf = 2e9;
const long long modulo = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  cin.ignore();
  vector<string> graph(n);
  for (int i = 0; i < n; i++) {
    getline(cin, graph[i]);
    graph[i] = "#" + graph[i] + "#";
  }
  char dir = 'r';
  int l = 1, r = 1, pos = 1, etage = 0;
  long long ans = 0;
  while (etage < n - 1) {
    if (graph[etage + 1][pos] == '.') {
      l = r = pos;
      ++etage;
      ++ans;
    } else if (graph[etage][l] == graph[etage][r] && graph[etage][r] == '#') {
      cout << "Never";
      return 0;
    } else {
      if (dir == 'r') {
        ans += (graph[etage][r] == '#') ? r - pos - 1 : r - pos;
        pos = (graph[etage][r] == '#') ? r - 1 : r;
        switch (graph[etage][pos + 1]) {
          case '.':
            pos = r = pos + 1;
            break;
          case '+':
            graph[etage][pos + 1] = '.';
            dir = 'l';
            break;
          case '#':
            dir = 'l';
            r = pos + 1;
            break;
        }
        ++ans;
      } else {
        ans += (graph[etage][l] == '#') ? pos - l - 1 : pos - l;
        pos = (graph[etage][l] == '#') ? l + 1 : l;
        switch (graph[etage][pos - 1]) {
          case '.':
            pos = l = pos - 1;
            break;
          case '+':
            graph[etage][pos - 1] = '.';
            dir = 'r';
            break;
          case '#':
            dir = 'r';
            l = pos - 1;
            break;
        }
        ++ans;
      }
    }
  }
  cout << ans;
  return 0;
}
